Questions tagged [kubernetes-statefulset]

357 questions
3
votes
3 answers

Using a variable within a path in Kubernetes

I have a simple StatefulSet with two containers. I just want to share a path by an emptyDir volume: volumes: - name: shared-folder emptyDir: {} The first container is a busybox: - image: busybox name: test command: - sleep -…
Diego
  • 35
  • 7
3
votes
2 answers

What happens when we upgrade a Statefulset to a newer image Version?

I have a 2 replicas of statefulsets with image name : ABC:1.1 No I want to Upgrade the statefulset to newer Version : ABC:1.2 ImagePullPolicy is set to always Also suppose once i already deployed the my statefulset with version ABC:1.2, then went…
3
votes
1 answer

Kubernetes stateful set: kill the pod if container dies

I have a situation where we are using stateful pods and I need to kill the pod when the container dies. restart policy: "Never" doesn't work for stateful sets. Is there a way to handle this situation with a stateful set? Can Kubernetes operator…
drifter
  • 389
  • 1
  • 5
  • 17
3
votes
2 answers

Kubernetes volumes: when is Statefulset necessary?

I'm approaching k8s volumes and best practices and I've noticed that when reading documentation it seems that you always need to use StatefulSet resource if you want to implement persistency in your cluster: "StatefulSet is the workload API object…
3
votes
1 answer

Kubernetes HPA (with custom metrics) scaling policies

Starting from Kubernetes v1.18 the v2beta2 API allows scaling behavior to be configured through the Horizontal Pod Autoscalar (HPA) behavior field. I'm planning to apply HPA with custom metrics to a StatefulSet. The use case I'm looking at is…
3
votes
0 answers

Kubernetes StatefulSet restart waits if one or more pods are not ready

I have a statefulset which constitutes of multiple pods. I have a use case where I need to invoke restart of the STS, I run this: kubectl rollout restart statefulset mysts If I restart the statefulset at a time when one or more pods are in not-ready…
3
votes
1 answer

Skipping a pod deployment in statefulset

I have a stateful set of pods, and due to the stateful nature of them one of them cannot be recreated due to some state error that deleting it wouldn't help. Since it's a stateful set kubernetes will block creation of additional pods until it's able…
ApriOri
  • 2,618
  • 29
  • 48
3
votes
4 answers

Kubernetes : How to delete a specific pod managed by StatefulSet without it being recreated?

I have a StatefulSet with 2 pods. It has a headless service and each pod has a LoadBalancer service that makes it available to the world. Let's say pod names are pod-0 and pod-1. If I want to delete pod-0 but keep pod-1 active, I am not able to do…
3
votes
1 answer

How to create a dependency between Kubernetes Deployments or StatefulSets

I have a couple of Stateful Sets, one is dependent on another one, I need the pods in the first Stateful Set to be in Ready state before the 2nd Stateful Set is started to be scaled. I'm looking to see if there is a way to link the two Stateful Sets…
3
votes
4 answers

Connect to Kubernetes mongo db in different namespace

Can anyone point out how to connect to the mongo db instance using mongo client using either command line client or from .net core programs with connection strings? We have created a sample cluster in digitalocean with a namespace, let's say…
Muthu
  • 2,675
  • 4
  • 28
  • 34
3
votes
1 answer

Kubernetes - How to create one Pod per Node?

I want a Kubernetes StatefulSet with: Number of Replicas/Pods = Number of Nodes in Kubernetes Cluster One Pod on on every node Is there a simple example on how to solve this typical requirement?
Simon_Prewo_Frankfurt
  • 1,209
  • 2
  • 11
  • 18
3
votes
2 answers

Readiness probe for statefulset, not individual pod/container

I have been reading about liveness and readiness probes in kubernetes and I would like to use them to check and see if a cluster has come alive. The question is how to configure a readiness probe for an entire statefulset, and not an individual…
2
votes
1 answer

Communication between pods of same statefulset

What is the recommended way to communicate between the pods belonging to the same statefulset? In my case, kubernetes services exposes an POST API. So when someone hits this API, the pod which is getting the request should pass the request to other…
2
votes
0 answers

Deploying MongoDB on Kubernetes

Suppose we're using Kubernetes Deployments to host MongoDB. I know that Deployments suppose their pods are identical, and the corresponding service divides requests between the pods regardless of which pod is which. Does this yield data…
Danial
  • 362
  • 4
  • 18
2
votes
1 answer

How to get the latest change time of StatefulSet in k8s

I know, for example, that you can get the lastUpdateTime of a Deployment with kubectl: kubectl get deploy -o jsonpath={.status.conditions[1].lastUpdateTime} Or via client-go: func deploymentCheck(namespace string, clientset…