Questions tagged [kubernetes-statefulset]

357 questions
7
votes
2 answers

Kubernetes StatefulSet - obtain spec.replicas metadata and reference elsewhere in configuration

I am configuring a StatefulSet where I want the number of replicas (spec.replicas as shown below) available to somehow pass as a parameter into the application instance. My application needs spec.replicas to determine the numer of replicas so it…
mjkrumlauf
  • 89
  • 1
  • 4
6
votes
1 answer

Dynamic route to a specific StateFulSet POD by hostname

I have a StatefulSet that has 2 replicas. I want to create an endpoint to be able to reach any of this replica, passing it hostname id, and in a way that if I scale it to more replicas, the new pods need to be reachable. I can do this creating an…
fabriciols
  • 959
  • 1
  • 12
  • 25
6
votes
4 answers

Recreate Pod managed by a StatefulSet with a fresh PersistentVolume

On an occasional basis I need to perform a rolling replace of all Pods in my StatefulSet such that all PVs are also recreated from scratch. The reason to do so is to get rid of all underlying hard drives that use old versions of encryption key. This…
lopek
  • 522
  • 5
  • 12
6
votes
3 answers

StatefulSet recreates pod, why?

I have my deployment, where I have defined postgres statefulSet, however I have it without PVC so if pod is dead - all data is gone. If I will list all pods I see below picture: pod1 - Running - 10 min pod2 - Running - 10 min postgresPod - Running -…
liotur
  • 809
  • 2
  • 17
  • 36
6
votes
1 answer

Configure starting index of StatefulSet's pods in Kubernetes

As we all know from the documentation: For a StatefulSet with N replicas, each Pod in the StatefulSet will be assigned an integer ordinal, from 0 up through N-1, that is unique over the Set. Example: apiVersion: apps/v1 kind:…
Amit Yadav
  • 4,422
  • 5
  • 34
  • 79
6
votes
3 answers

Kubernetes mysql statefulset with root password

I followed the example in here https://kubernetes.io/docs/tasks/run-application/run-replicated-stateful-application/ to create a 3 replica mysql statefulset in kubernetes and everything works fine. However, after I added root password, and modified…
Jingshao Chen
  • 3,405
  • 2
  • 26
  • 34
6
votes
0 answers

Dynamic storage provisioning on single bare metal node

Is there a way to achieve dynamic storage provisioning on a single, bare metal, kubernetes node? I need the storage volumes to be dynamically provisioned for StatefulSet with multiple replicas. Because I haven't found one yet. glusterfs requires at…
zub0r
  • 1,299
  • 1
  • 14
  • 20
5
votes
2 answers

0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims

As the documentation states: For each VolumeClaimTemplate entry defined in a StatefulSet, each Pod receives one PersistentVolumeClaim. In the nginx example above, each Pod receives a single PersistentVolume with a StorageClass of my-storage-class…
e7lT2P
  • 1,635
  • 5
  • 31
  • 57
5
votes
1 answer

statefulset unable to rollback if the pods are not in running state

I have deployed mongo stateful pods with an auto rolling strategy and below is the template for it. The deployment is successful and the pods are into Running state. - apiVersion: apps/v1beta1 kind: StatefulSet metadata: name: mongo spec: …
Bhavani Prasad
  • 1,079
  • 1
  • 9
  • 26
5
votes
3 answers

Move Kubernetes statefulset pod to another node

My k8s cluster initially have 2node and 1master and I deployed statefulset with 3pods, so 3pods with PVC are running on 2 nodes. Now I increased nodes from 2 to 3. So now k8s is 3nodes and 1master. I would like to move one of the statefulset pod to…
5
votes
2 answers

How to mount a configMap as a volume mount in a Stateful Set

I don't see an option to mount a configMap as volume in the statefulset , as per https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#statefulset-v1-apps only PVC can be associated with "StatefulSet" . But PVC does not have option…
5
votes
1 answer

StatefulSets vs Deployments for stateless applications on Kubernetes

I find tons of articles and documentation describing the advantages of StatefulSets over Deployments for stateful applications on Kubernetes. What I haven't been able to figure out is the opposite: the disadvantages of StatefulSets when compared to…
chrisvdb
  • 2,080
  • 2
  • 20
  • 28
5
votes
2 answers

Is it required to use a headless service for statefulsets?

Have a couple of question on headless services: Is it required to use a headless service for statefulsets? Can I use the normal service.yml for the stateful sets also? Is it required to use a service & then a headless service? Can I just use…
Sandy
  • 946
  • 11
  • 14
5
votes
0 answers

Update Kafka in Kubernetes causes downtime

I'm running a 4 brokers Kafka cluster in Kubernetes. The replication factor is 3 and ISR is 2. In addition, there's a producer service (running Spring stream) generating messages and a consumer service reading from the topic. Now I tried to update…
Yuval
  • 764
  • 1
  • 9
  • 23
5
votes
3 answers

Kubernetes Stateful set, AZ and Volume claims: what happens when an AZ fails

Consider a Statefulset (Cassandra using offical K8S example) across 3 Availability zones: cassandra-0 -> zone a cassandra-1 -> zone b cassandra-2 -> zone c Each Cassandra pod uses an EBS volume. So there is automatically an affinity. For instance,…
1
2
3
23 24