☸️ Fix a StatefulSet Stuck Waiting on Ordinal Zero
A StatefulSet’s default podManagementPolicy is OrderedReady, which means ordinal N+1 is never even created until ordinal N has reported Ready – a guarantee that exists so replicas with real startup ordering dependencies (a primary before its replicas, say) come up safely. The side effect is that if ordinal zero itself is crash-looping – a bad config value, a failing one-time migration, a dependency that isn’t reachable yet – every other replica in the set simply never gets created at all, so a StatefulSet that should have five pods shows exactly one, unhealthy, with nothing further scheduled anywhere.
🔎 The Problem
$ kubectl get pods -l app=queue-worker NAME READY STATUS RESTARTS AGE queue-worker-0 0/1 CrashLoopBackOff 6 9m # queue-worker-1, queue-worker-2 ... never even appear # because the StatefulSet's default podManagementPolicy is OrderedReady: # ordinal N+1 is not created until ordinal N reports Ready
✅ Fix: Diagnose Ordinal Zero First
- Describe and fix pod-0 first (kubectl describe pod queue-worker-0, kubectl logs) – under the default OrderedReady policy nothing later in the ordinal sequence is even scheduled until ordinal 0 passes its readiness probe.
- If the workload doesn’t genuinely depend on strict startup ordering between replicas (a stateless-ish worker sharing a StatefulSet only for its stable network identity, say), set spec.podManagementPolicy to Parallel so a crash in one ordinal doesn’t block every other replica from starting.
- Add a startupProbe with a realistic initialDelaySeconds for ordinal 0’s own slow-start path (migrations, cache warmup) instead of assuming any CrashLoopBackOff there is a real failure – a readiness probe tuned for steady state is often just too impatient for the very first pod’s one-time startup cost.
🚨 Why This Is Dangerous
A StatefulSet stuck on ordinal zero shows exactly one unhealthy pod in kubectl get pods, so it reads like a small, contained problem – when in fact it’s silently preventing every other replica in the set from ever being created at all.
A StatefulSet’s ordering guarantee is a feature until you forget you asked for it, and then one stuck pod looks like it’s blocking the whole fleet – because it is.




