CrashLoopBackOff and Restart Backoff
Why does a broken container restart slower and slower? The Kubelet backs off exponentially, doubling the wait from 10s up to a default 5 minute cap, so a crashing process cannot hot-loop and saturate the Node. During each wait the container reports Waiting with reason CrashLoopBackOff while the Pod phase stays Running, and a clean 10 minutes resets the backoff, so a new crash counts as a first one, restarted at once. CrashLoopBackOff is a symptom, never the cause.
Play the animation 5 steps, animated, best on a wide screen
CrashLoopBackOff and Restart Backoff, step by step
-
The container process exits with a non-zero code and Kubelet observes the termination. With restartPolicy Always, Kubelet restarts it immediately the first time and arms a 10s base delay for the next one. Once the new container starts, restartCount becomes 1.
Play from step 1 -
The fresh container crashes again almost immediately. This second restart is the one that waits 10s, and it arms a doubled 20s for the next one. While Kubelet holds off the third restart the container state is Waiting with reason CrashLoopBackOff, which surfaces in kubectl get pods.
Play from step 2 -
The crashes keep coming and the backoff delay doubles with each restart, climbing 40s then 80s then 160s. The restartCount keeps incrementing on every attempt. The backoff is kept per container, and it stops a hot-looping process from saturating the Node.
Play from step 3 -
The next doubling would exceed 300s, so the delay is clamped at the 300s ceiling, a per-node default since 1.35, and stays there. Kubelet now retries the container at most once every 5 minutes for as long as it keeps failing. The restartCount continues to climb at this slow cadence.
Play from step 4 -
The bug is fixed and the new container runs stably. After 10 minutes healthy Kubelet resets the backoff: a new crash counts as a first one, restarted at once, with the next wait back at 10s, not 300s. The container state returns to Running and the CrashLoopBackOff reason clears.
Play from step 5