Questions tagged [kubernetes-statefulset]
357 questions
113
votes
2 answers
Why StatefulSets? Can't a stateless Pod use persistent volumes?
I am trying to understand Stateful Sets. How does their use differ from the use of "stateless" Pods with Persistent Volumes? That is, assuming that a "normal" Pod may lay claim to persistent storage, what obvious thing am I missing that requires…

Laird Nelson
- 15,321
- 19
- 73
- 127
36
votes
2 answers
Kubernetes - pod has unbound immediate PersistentVolumeClaims
I'm using mysql Kubernetes statefulset, i mapped PVs to host directory (CentOS 8 VM) but getting " pod has unbound immediate PersistentVolumeClaims"
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql-container
spec:
serviceName: mysql
…

overflowed
- 1,095
- 1
- 18
- 39
26
votes
3 answers
Kubectl rollout restart for statefulset
As per the kubectl docs, kubectl rollout restart is applicable for deployments, daemonsets and statefulsets. It works as expected for deployments. But for statefulsets, it restarts only one pod of the 2 pods.
✗ k rollout restart statefulset…

livinston
- 1,218
- 2
- 12
- 18
12
votes
5 answers
Is it possible to assign a pod of StatefulSet to a specific node of a Kubernetes cluster?
I have a 5 node cluster(1-master/4-worker). Is it possible to configure a StatefulSet where I can make a pod(s) to run on a given node knowing it has sufficient capacity rather Kubernetes Scheduler making this decision?
Lets say, my StatefulSet…

Jaraws
- 581
- 1
- 7
- 24
11
votes
2 answers
Kubectl wait for one pod of a statefulset to be READY?
To wait for a certain pod to be completed the command is
kubectl wait --for=condition=Ready pod/pod-name
Similarly I want to wait for any one pod in the statefulset to be ready. I tried the command below which did not work,
kubectl wait…

agirlwithnoname
- 111
- 1
- 3
11
votes
4 answers
how to setup basic rabbitmq on kubernetes
I need to setup a basic rabbit mq instance (no cluster setup) without persistence or security requirements on a kubernetes cluster.
What I need:
Single rabbit mq pod running as stateful set with replicas = 1, and
reach it from inside and outside of…

Martin
- 111
- 1
- 1
- 3
10
votes
2 answers
How to set pvc with statefulset in kubernetes?
On GKE, I set a statefulset resource as
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
spec:
serviceName: "redis"
selector:
matchLabels:
app: redis
updateStrategy:
type: RollingUpdate
replicas: 3
template:
…

iooi
- 453
- 2
- 10
- 23
10
votes
2 answers
What are some pros and cons of parallel podManagementPolicy over OrderedReady podManagementPolicy in StatefulSets?
I have recently updated podManagementPolicy field in my StatefulSet from default(OrderedReady) to Parallel.
It has significantly reduced the scale-up and scale-down time.
I have not seen any downsides of this change as of now, but I am worried if…

himanshu
- 175
- 3
- 12
10
votes
2 answers
Sharded load balancing for stateful services in Kubernetes
I am currently switching from Service Fabric to Kubernetes and was wondering how to do custom and more complex load balancing.
So far I already read about Kubernetes offering "Services" which do load balancing for pods hidden behind them, but this…

Sossenbinder
- 4,852
- 5
- 35
- 78
8
votes
3 answers
Why am I getting `0/1 nodes are available` when running Docker Desktop?
I'm running Docker Desktop with Kubernetes.
I can ssh to the node and I have other pods running on the node.
However, when I apply a StatefulSet to the cluster I get:
0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.…

Snowcrash
- 80,579
- 89
- 266
- 376
8
votes
2 answers
Error when creating a mongodb replicaset - shows unrecognized option '--smallfiles'
I am creating the below mongodb statefulset which creates 3 replicas but when I run the code I get the below error and all pods are in CrashLoopBackOff state.
This is the error which I get when I try kubectl create -f
Error parsing command line:…

jeril
- 1,109
- 2
- 17
- 35
8
votes
1 answer
Pod has unbound PersistentVolumeClaims but volume claims is bounded
I want to create a statefulset elasticsearch in kubernetes on virtualbox. I'm not using cloud provider so i create two persistent volume localy for my two replicas of my statefulset :
pv0:
kind: PersistentVolume
apiVersion: v1
metadata:
name:…

Yummel
- 103
- 1
- 2
- 11
7
votes
1 answer
apply HPA for Statefulset in kubernetes?
I am trying to setup HPA for my statefulset(for elasticsearch) in kubernetes environment. I am planning to scale the statefulset using the cpu utilization. I have created the metric server from…

manu thankachan
- 433
- 3
- 9
- 19
7
votes
2 answers
Kubernetes rolling update without downtime?
According to https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#scaling-a-statefulset, I would like to ask how to achieve zero-downtime rolling update? I guess here are the minimum requirements:
(1) .spec.updateStrategy…

Kok How Teh
- 3,298
- 6
- 47
- 85
7
votes
1 answer
Stateful set not shifting to a new node
I have deployed a stateful set app on my Kubernetes cluster. It has persistent volumes etc and a replica of one. The issue I face is that when I turn off the node where the stateful set is running, the pod does not restart on a new node. It…

devops84uk
- 691
- 2
- 6
- 20