Pod Lifecycle Phases

A container inside a Pod keeps crashing and restarting, yet the phase of the Pod stays Running the whole time. What does that phase tell you, what does it hide, and when does the Pod leave Running for good?

Play the animation 5 steps, animated, plays on a computer or a tablet

Pod Lifecycle Phases, Kubernetes diagram

Pod Lifecycle Phases, step by step

  1. The Pod is bound to a Node, so Kubelet picks it up, creates the sandbox and pulls the image, and the container sits in Waiting with reason ContainerCreating. The status.phase field stays Pending while any container is still waiting for its first start, so the machine does not move at all here.

    Play from step 1
  2. Every container has been created and at least one is running, so status.phase takes its one healthy edge from Pending to Running. A container that crash-loops inside the Pod will not move the phase again, however long that loop lasts. The exception is a RestartAllContainers rule, which can send the Pod back to Pending. Running says where the Pod is in its life, not whether it is healthy.

    Play from step 2
  3. The container exits non-zero, and Kubelet restarts it in the same sandbox. Repeated fast failures push the container into Waiting with reason CrashLoopBackOff while a backoff timer ticks. CrashLoopBackOff is a container-level waiting reason and never a phase of its own, so it is drawn inside Running. The machine has not moved, and status.phase still reads Running.

    Play from step 3
  4. The backoff timer elapses, Kubelet starts the container again and this time it runs, so the container state returns to Running and restartCount records how many restarts it took. Through the whole episode status.phase never left Running, so a reader watching only the phase would have seen nothing happen.

    Play from step 4
  5. The container exits 0 and OnFailure does not restart a success, so every container is Terminated and status.phase becomes Succeeded. Under restartPolicy Never with no container-level override, a non-zero exit brings no restart, and the machine takes the edge to Failed. Both are terminal and absorbing. The Pod will not run again. The fifth value, Unknown, was deprecated in 1.22.

    Play from step 5

Sources