Container Lifecycle (within a Pod)
Each container follows this:
- Image Pull (if not present)
- Created
- Started
- Running
- Stopped (Exited) — success or failure
- Restarted (if policy is
Always
orOnFailure
) - Terminated
Pod Lifecycle Phases
- Pending
- Pod accepted by the API server, but not yet running on any node.
- Scheduled
- Pod has been assigned to a specific node by the scheduler.
- Initialized
- All
initContainers
have successfully completed (if any).
- All
- Running
- Pod’s main containers are running or starting.
- Ready
- Pod has passed all readiness probes and is ready to serve traffic.
- Succeeded
- All containers completed successfully (exit code 0) — common for Jobs.
- Failed
- One or more containers exited with an error and won’t be restarted.
- Unknown
- The pod’s state can’t be determined (e.g., node crash/unreachable).
- Terminating(transitional state)
- Pod is being deleted; Kubernetes tries to shut it down gracefully.