Questions tagged [kubernetes-statefulset]

357 questions
2
votes
1 answer

What type of edits will change a ReplicaSet and StatefulSet AGE?

What type of edits will change a ReplicaSet and StatefulSet AGE(CreationTimeStamp)? I'm asking this because I noticed that If I change a Deployment image, a new ReplicaSet will be created. The old ReplicaSet continues to exist with DESIRED set to…
2
votes
1 answer

Kubernetes Statefulsets: Restart all pods concurrently (instead of in sequence)

I have a use-case for concurrent restart of all pods in a statefulset. Does kubernetes statefulset support concurrent restart of all pods? According to the statefulset documentation, this can be accomplished by setting the pod update policy to…
Traiano Welcome
  • 783
  • 2
  • 12
  • 24
2
votes
2 answers

K8s StatfullSets "pending" after node scale

First of all: I readed other posts like this. My staging cluster is allocated on AWS using spot instances. I have arround 50+ pods (runing diferent services / products) and 6 StatefulSets. I created the StatefulSets this way: OBS: I do not have PVs…
2
votes
2 answers

How to Connect Golang application to mysql statefulset in Kubernetes

I followed the official walkthrough on how to deploy MySQL as a statefulset here https://kubernetes.io/docs/tasks/run-application/run-replicated-stateful-application/ I have it up and running well but the guide says: The Client Service, called…
2
votes
1 answer

Is there a way to set max/min replicas on Kubernetes statefulset?

For ReplicaSets I see there is a way to use a Horizontal Pod Autoscaler (HPA) and set a max/min value for the number of replicas allowed. Is there a similar feature for StatefulSets? Since it also allows you to specify the number of replicas to…
Jim
  • 119
  • 4
  • 14
2
votes
2 answers

Docker Mysql official image not creating user in kubernetes

I'm trying to deploy a mysql instance in k8s through a StatefulSet using the official Mysql image from DockerHub. I'm following the image documentation from DockerHub and providing MYSQL_ROOT_PASSWORD, MYSQL_USER and MYSQL_PASSWORD env vars, so the…
2
votes
1 answer

Statefulset not working in local minikube. It gives, Error from server (BadRequest): pod mysql-0 does not have a host assigned

apiVersion: apps/v1 kind: StatefulSet metadata: name: mysql namespace: cp1 spec: selector: matchLabels: app: mysql serviceName: mysql replicas: 1 template: metadata: labels: app: mysql spec: …
2
votes
2 answers

Error on StatefulSet creation for mongodb on Kubernetes

While creating stateful set for mongodb on kubernetes, I am getting below error. "is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden" statefulset.yaml --- …
SVD
  • 385
  • 4
  • 24
2
votes
1 answer

If we have only one replica of the stateful pod, can we use Deployment resource instead of StatefulSet?

I read a bit about Deployment vs StatefulSet in Kubernetes. We usually need StatefulSet when we have a stateful app, so every pod can have its own volume. Now, I have a task to introduce persistence for RabbitMq. I will have only one pod replica of…
2
votes
2 answers

How can I expand a PVC for Cassandra on AKS without losing data?

I need to start by saying that I have no experience using Cassandra and I am not the one who who created this deployment. I have Cassandra running in a cluster in AKS. The PVC as configured in the statefulset is 1000Gi. Currently the pods are out of…
2
votes
1 answer

How to find the immutable fields in a kubernetes workload spec?

Is there a way to find the immutable fields in the workload's spec? I could see there are few fields mentioned as immutable in some of the workload resource documentation, But for example in StatefulSet is not clear which are immutable fields. Is…
ennc0d3
  • 45
  • 4
2
votes
1 answer

Hostname of pods in same statefulset can not be resolved

I am configuring a statefulset deploying 2 Jira DataCenter nodes. The statefulset results in 2 pods. Everything seems fine until the 2 pods try to connect to eachother. They do this with their short hostname being jira-0 and jira-1. The jira-1 pod…
Charlie
  • 521
  • 1
  • 4
  • 17
2
votes
1 answer

Kubernetes StatefulSets and livenessProbes

Liveness probes are supposed to trigger a restart of failed containers. Do they respect the default stateful set deployment and scaling guarantees. E.g. if the liveness probe fails at the same time for multiple pods within one and the same stateful…
2
votes
1 answer

Passing seperate env variables to statefulset pods

I'm deploying two statefulset pods of same image running as headless service. I wish to pass seperate env variables to containers running same images inside statefulset pods. May anyone tell me how to achieve this ?
medgai
  • 82
  • 4
  • 13
2
votes
1 answer

How to mount an existing file-based DB for a StatefulSet to each kubernetes pod independently?

Right from start: very beginner in kubernetes here. I (think to) know how I can create a volume for my StatefulSet for persistence. For that, I have volumeMounts: - name: db mountPath: /var/lib/mydb and -…