Pod Lifecycle States

Difficulty: Beginner

Question

What are the possible phases of a Pod, and how do they relate to the STATUS values like CrashLoopBackOff that you see in kubectl?

Answer

A Pod's status.phase has exactly five values: Pending, Running, Succeeded, Failed and Unknown. The phase is a high-level summary; the detail lives in each container's state (Waiting, Running, Terminated) and in Pod conditions such as Ready. Values like CrashLoopBackOff, ContainerCreating or Terminating that appear in kubectl get pods are reasons or derived statuses, not phases.

The five phases

PhaseMeaningCommon causes
PendingAccepted by the API server, but one or more containers are not running yetWaiting for scheduling, pulling images, mounting volumes
RunningBound to a node, all containers created, at least one running or restartingNormal state for services
SucceededAll containers exited with code 0 and will not restartCompleted Job Pods
FailedAll containers terminated and at least one failed (non-zero or killed by the system)Job with restartPolicy: Never that crashed, evicted Pods
UnknownThe control plane cannot get the Pod's stateNode lost contact with the API server

A Pod reaches Succeeded or Failed only when its containers will not be restarted. With the default restartPolicy: Always (used by Deployments), a crashing container keeps being restarted, so the phase stays Running even though the app is broken.

Container states and the STATUS column

Each container is in one of three states:

  • Waiting, with a reason such as ContainerCreating, ImagePullBackOff, ErrImagePull, CreateContainerConfigError or CrashLoopBackOff.
  • Running.
  • Terminated, with an exit code and a reason such as Completed, Error or OOMKilled.

kubectl get pods shows the most useful reason in the STATUS column. So CrashLoopBackOff means "the container keeps exiting and the kubelet is waiting an increasing back-off (up to 5 minutes) before restarting it", while the phase is still Running. Terminating means the Pod has a deletionTimestamp and is shutting down gracefully.

Pod conditions

Conditions answer more specific yes/no questions:

  • PodScheduled: assigned to a node.
  • PodReadyToStartContainers: sandbox and networking are ready (newer clusters).
  • Initialized: all init containers completed.
  • ContainersReady: all containers pass readiness.
  • Ready: the Pod can receive Service traffic.

A Pod can be Running but not Ready, for example when its readiness probe fails. It stays out of Service endpoints until it recovers.

How to use this when debugging

  • Pending for a long time: kubectl describe pod and look for FailedScheduling (not enough CPU/memory, taints, affinity) or image pull errors.
  • CrashLoopBackOff: kubectl logs <pod> --previous to see why it died.
  • OOMKilled (exit 137): raise the memory limit or fix the leak.
  • Unknown: check the node with kubectl get nodes and kubectl describe node.
Pod phase lifecycle. Most Pods move from Pending to Running, and only end in Succeeded or Failed if containers are not restarted.
  1. Pending: Scheduling, image pull and volume mounts happen here.
  2. Running: Bound to a node with at least one container running.
  3. Succeeded or Failed: All containers terminated and will not restart.
  4. Unknown (side path): Node stopped reporting, state cannot be read.

Code examples

Reading phase, container state and conditions

# Phase only (never shows CrashLoopBackOff)
kubectl get pod api-6f7c9 -o jsonpath='{.status.phase}'
# Running

# Why the container is unhappy
kubectl get pod api-6f7c9 \
  -o jsonpath='{.status.containerStatuses[0].state}'
# {"waiting":{"reason":"CrashLoopBackOff",...}}

# Last crash exit code
kubectl get pod api-6f7c9 \
  -o jsonpath='{.status.containerStatuses[0].lastState.terminated.exitCode}'

# Pods by phase across the cluster
kubectl get pods -A --field-selector status.phase=Failed

The phase says Running while the container state reveals CrashLoopBackOff, which is exactly the distinction interviewers probe.

Key points

  • Five phases only: Pending, Running, Succeeded, Failed, Unknown.
  • CrashLoopBackOff, ImagePullBackOff, ContainerCreating are container Waiting reasons, not phases.
  • With restartPolicy Always, a crashing Pod stays in phase Running.
  • Running does not mean Ready; readiness controls Service traffic.
  • Exit code 137 usually means SIGKILL, often OOMKilled.

Common follow-up questions

  • How do you debug a Pod stuck in CrashLoopBackOff?
  • What is the difference between Running and Ready?
  • What happens to Pods when a node goes Unknown for several minutes?
  • How do init containers affect the Pod phase?

Interview tips

  • List the five phases, then immediately clarify that CrashLoopBackOff is not one of them.
  • Mention restartPolicy and how it decides whether a Pod can ever reach Succeeded or Failed.
  • Tie each state to a debugging command to show hands-on experience.

Concepts covered

Pod Phase, Container States, Pod Conditions, CrashLoopBackOff, Restart Policy

More Kubernetes & Orchestration questions