StatefulSet stuck — ordered readiness, PVC pending, or headless service issue
StatefulSet pods stuck in Pending or ContainerCreating sequentially
Focused incident mode — strips away everything but this runbook.
Symptoms
- StatefulSet pods stuck in Pending or ContainerCreating sequentially
- kubectl rollout status statefulset hangs on pod ordinal N
- StatefulSet never reaches desiredReady count
StatefulSet pods start in order (0, 1, 2...). If pod 0 is stuck, no subsequent pod will start. Fix the root cause of pod 0 first.
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
StatefulSet status
kubectl describe statefulset <name> -n <namespace>PVC status for StatefulSet pods
kubectl get pvc -n <namespace> | grep <statefulset>
Diagnostic flow
Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.
Guided decision tree is ready.
Steps with commands, expected output, and pass/fail branches.
Ranked root causes
Evidence checklist
- kubectl get pvc shows Pending for <name>-0
- Pod stuck in ContainerCreating waiting for volume
Confirm before fixing
kubectl describe pvc <name>-<ordinal> -n <namespace>Read PVC events
Fix
kubectl get storageclass -o wideEnsure the StorageClass provisioner is running and defaults are set (follow pvc-pending runbook)
Resolution runbook
Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.
kubectl rollout status statefulset <name> -n <namespace>Identify which ordinal is stuck
kubectl get pvc -n <namespace> | grep <name>Check PVC status for all pods
kubectl get svc <name> -n <namespace> -o jsonpath='{.spec.clusterIP}'Confirm headless service exists (clusterIP=None)
kubectl describe pod <name>-0 -n <namespace> | tail -20Read events for the stuck pod
Prevention
- Ensure PVC storage is provisioned before deploying the StatefulSet.
- Always create the headless Service before the StatefulSet.
- Use parallel podManagementPolicy if ordering is not required.
- Monitor PVC binding and StatefulSet readyReplicas as part of the deploy pipeline.
Related runbooks
Same stack, same failure family — worth a skim.
kubectl get pvc shows Pending
kubectl rollout status hangs on 'Waiting for rollout to finish'
PV stays in Released state for hours after PVC deletion
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.