Node
Probes and restarts
CrashLoopBackOff, explained
Liveness and readiness probes, restart counts, and the backoff that doubles up to five minutes. A bad setting makes one web Pod crash on boot, again and again. Watch the kubelet try, wait, double the wait, and take the Pod out of the Service - until the fix lands and the clock resets.
- Pod
- web-…-p8m4z · node-2
- Restart policy
- Always - every exit earns a retry
- Backoff
- 10 s → 20 → 40 → 80 → 160 → 300, capped
- Probes
- readiness stops traffic · liveness forces restart
Read the whole lesson as text
1. The exit
Zoom into node-2. A rollout gave web-…-p8m4z a bad ConfigMap value, and its container is a sprinter: it starts, reads LOG_LEVEL=debugg, fails fast and exits 1 - 400 milliseconds in. containerd reports the exit to the kubelet over CRI, with the code and the start time. The Pod object still exists; only the process is gone.
- The container starts for the first time with the broken setting.
- Four hundred milliseconds later the app gives up and exits 1.
- The kubelet hears about the exit and reaches for the restart policy.
2. Wait, retry, wait
The restart is not immediate: the kubelet starts a backoff clock at 10 seconds. The container sits in state Waiting with reason CrashLoopBackOff - a wait state, not an error in itself. At t=10 s the container starts again, reads the same broken env, and exits 1 again. The clock doubles.
- The kubelet reports the container waiting, with the reason every operator knows by heart.
- Ten seconds in, the container starts again - with the same environment.
3. The doubling
Every crash doubles the next wait: 10, 20, 40, 80, 160, then 300 seconds, where it caps. Nothing else escalates - no alert, no eviction, no Node selector. The Pod sits in this loop indefinitely, retrying every five minutes, while its ReplicaSet counts it as owned and the Service quietly routes around it. Only a change to the container's inputs breaks the cycle.
- From the outside, the status never changes: CrashLoopBackOff, restartCount climbing.
- The Service dropped this Pod long ago; the loop is invisible to traffic.
4. Two probes
Probes are the two independent health opinions, and they act on different things. The readiness probe failed at 300 ms - before the first crash - so the endpoint was pulled: no traffic. The liveness probe never even ran, because the container dies first; had the app hung instead of exited, three liveness failures would have made the kubelet kill it and start a fresh one. Readiness owns the endpoints list; liveness owns the process.
- Each attempt, the kubelet tries the health check first - and it never passes.
- A liveness failure would mean kill and restart - a hammer readiness doesn't have.
5. The fix lands
Someone fixes the typo and the rollout updates the ConfigMap into the Pod's next container. This start reads LOG_LEVEL=debug and boots, because the kubelet resolves env from the ConfigMap afresh for every new container. The readiness probe passes on the second try, Ready flips true, the kubelet reports it, and the endpoint comes back. Once the container has run cleanly for 10 minutes, the kubelet resets the backoff clock. Total outage for this Pod: one bad deploy and about ten minutes of looping.
- The typo is fixed and applied.
- The next retry starts with the corrected environment - and it stays up.
- The health check passes, and the Pod is allowed back into the Service.
- The endpoint returns and traffic resumes, three of three again.
Summary
CrashLoopBackOff is not an error - it's the kubelet patiently retrying a container whose inputs haven't changed, on a doubling schedule that tops out at five minutes. The two probes did their separate jobs the whole time: readiness kept traffic away, liveness stood by with the hammer. The moment the input changed, one clean boot ended the loop.
Next lesson: OOMKilled