How to fix StatefulSet partition in Kubernetes
StatefulSet partition controls phased rolling updates by specifying which pod ordinals receive new versions. Misconfigured partitions can prevent updates from propagating or leave StatefulSets stuck in non-ready states. Fix by correctly configuring the updateStrategy.rollingUpdate.partition value relative to replicas.
Quick fix
Fixes StatefulSet partition
kubectl get statefulset <name> -o jsonpath='{.spec.updateStrategy.rollingUpdate.partition}'
# Should return a number or null (0)
kubectl get statefulset <name> -o yaml | grep -A 5 updateStrategy
kubectl get pods -l app=<app-label> --sort-by=.metadata.name- Verify current StatefulSet partition configuration
- Understand partition semantics
- Reset partition to allow all updates
- For staged rollout, use partition correctly
kubectl get statefulset <name> -o jsonpath='{.spec.updateStrategy.rollingUpdate.partition}'# Should return a number or null (0)kubectl get statefulset <name> -o yaml | grep -A 5 updateStrategykubectl get pods -l app=<app-label> --sort-by=.metadata.nameStatefulSet partition
What this error means
StatefulSets support partitioned rolling updates via the .spec.updateStrategy.rollingUpdate.partition field. This allows staged deployments: pods with ordinals >= partition receive new template versions, while pods with ordinals < partition retain the old version. This is useful for canary deployments and phased rollouts. Issues occur when the partition value is misconfigured relative to the number of replicas, preventing updates or blocking pod readiness.
Typical symptoms
- StatefulSet pods not updating despite template changes
- StatefulSet stuck in "not ready" state after partition changes
- Pods with lower ordinals keeping old configuration while others update
- kubectl describe statefulset shows incorrect partition values (pointer instead of value)
- Rolling update fails to complete when partition is adjusted
- Some pods never become ready in OrderedReady pod management policy
- Canary deployment not working as expected with partition strategy
Common causes
- Partition value >= replicas, preventing any pod updates
- Partition changed mid-deployment, causing inconsistent pod states
- Pod template configured to never become Ready (bad binary or config)
- Kubernetes version with partition bug (pre-1.28 had various partition issues)
- Misunderstanding partition semantics (thinking >= means "exclude" instead of "include")
- Network partition or control plane issues during partition updates
- OrderedReady policy waiting for lower-ordinal pods that are stuck
How to fix "StatefulSet partition"
Check the StatefulSet spec and current pod states:
kubectl get statefulset <name> -o jsonpath='{.spec.updateStrategy.rollingUpdate.partition}'
# Should return a number or null (0)
kubectl get statefulset <name> -o yaml | grep -A 5 updateStrategy
kubectl get pods -l app=<app-label> --sort-by=.metadata.nameNote the current partition value and number of replicas.
StatefulSet partition works as follows:
replicas: 3 (pods: app-0, app-1, app-2)
partition: 2
Result:
- Pods app-2 (ordinal >= 2): Get NEW template
- Pods app-0, app-1 (ordinal < 2): Keep OLD templateIf partition is greater than or equal to replicas, NO pods receive updates:
replicas: 3
partition: 3 # BUG - no pods update
partition: 5 # BUG - no pods updateIf StatefulSet is stuck, reset partition to 0 (all pods get updated):
kubectl patch statefulset <name> -p '{"spec":{"updateStrategy":{"type":"RollingUpdate","rollingUpdate":{"partition":0}}}}'
# Verify patch applied
kubectl get statefulset <name> -o jsonpath='{.spec.updateStrategy.rollingUpdate.partition}'This forces the rolling update to proceed for all pods.
To update only pods with ordinal >= N:
# Test update on pod-2 only (3 replicas, partition=2)
kubectl patch statefulset web -p '{"spec":{"updateStrategy":{"type":"RollingUpdate","rollingUpdate":{"partition":2}}}}'
# Update pod template
kubectl set image statefulset/web web=myapp:v2
# Monitor pod-2 update
kubectl rollout status statefulset/web
# Once pod-2 is healthy, allow pod-1
kubectl patch statefulset web -p '{"spec":{"updateStrategy":{"type":"RollingUpdate","rollingUpdate":{"partition":1}}}}'
# Finally, allow pod-0
kubectl patch statefulset web -p '{"spec":{"updateStrategy":{"type":"RollingUpdate","rollingUpdate":{"partition":0}}}}'If pods are stuck despite partition reset, check pod readiness:
# Check why pods aren't ready
kubectl describe pod <name-0>
# Look for: conditions, events, and recent restarts
kubectl logs <name-0> --previous # If pod was killed
kubectl get pod <name-0> -o yaml | grep -A 10 conditionsOrderedReady waits for pod N before updating pod N+1. If pod-0 never becomes Ready, pod-1 and pod-2 won't update. Fix the pod template (bad binary, missing config, resource limits, etc.) first.
Monitor partition update progress:
# Watch partition field and pod updates
kubectl get statefulset <name> -w
# Check individual pod templates
kubectl get pod <name-2> -o jsonpath='{.spec.containers[0].image}'
# For kubectl describe displaying incorrect partition (pre-1.27 bug)
kubectl describe statefulset <name> | grep Partition
# Ignore if it shows a large number; check with jsonpath insteadSeveral partition-related bugs were fixed in recent Kubernetes versions:
- v1.28+: Improved partition status reporting in rollout progress
- v1.27: Fixed kubectl describe showing pointer instead of partition value
- v1.26+: More reliable partition state transitions
If running older versions:
kubectl version --short # Check your version
# Consider upgrading via kubeadm or cloud provider toolsCheck your cluster's upgrade path and plan the upgrade.
Advanced notes
Partition enables canary deployments and staged rollouts without templating tools. For complex rollout strategies, consider using tools like Flagger, Argo Rollouts, or cloud provider features (GKE Autopilot rollout policies). Note: partition works with RollingUpdate strategy only (not OnDelete). When partition equals or exceeds replicas, updates don't propagate—a common mistake. OrderedReady policy makes partition debugging harder since pod N-1 must be Ready before pod N updates. For stateless workloads or rapid iteration, consider Deployment instead of StatefulSet.
Frequently asked questions
- What does "StatefulSet partition" mean?
- partition field. This allows staged deployments: pods with ordinals >= partition receive new template versions, while pods with ordinals < partition retain the old version. This is useful for canary deployments and phased rollouts.
- How do I fix "StatefulSet partition"?
- StatefulSet partition controls phased rolling updates by specifying which pod ordinals receive new versions. Misconfigured partitions can prevent updates from propagating or leave StatefulSets stuck in non-ready states. Fix by correctly configuring the updateStrategy.rollingUpdate.partition value relative to replicas.
- What causes "StatefulSet partition"?
- Partition value >= replicas, preventing any pod updates Partition changed mid-deployment, causing inconsistent pod states Pod template configured to never become Ready (bad binary or config)
- Is the "StatefulSet partition" error serious?
- It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- 📚Kubernetes Official Documentation
- 📖Kubernetes Docs: statefulset(Official Docs)
- 📖Kubernetes Docs: basic stateful set(Official Docs)
- 🐙
- 🐙
- 🐙GitHub #8674: helm/helm(GitHub)