0
0
Kubernetesdevops~10 mins

Pod lifecycle states in Kubernetes - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Pod lifecycle states
Pending
Running
Succeeded
Failed
Unknown
This flow shows how a Kubernetes Pod moves through phases from Pending to terminal states.
Execution Sample
Kubernetes
kubectl get pod mypod -o jsonpath='{.status.phase}'
# Output shows current Pod state
This command checks the current lifecycle state of a Pod named 'mypod'.
Process Table
StepPod StateConditionActionResult
1PendingPod object created in clusterStart schedulingPod enters Pending
2PendingWaiting for container images and node assignmentSchedule Pod to nodePod moves to Running
3RunningContainers are runningMonitor container statusPod stays Running or moves to terminal state
4RunningContainer exits with code 0Mark Pod as SucceededPod moves to Succeeded
5RunningContainer exits with error codeMark Pod as FailedPod moves to Failed
6RunningStatus unknown due to node issuesMark Pod as UnknownPod moves to Unknown
7Succeeded/Failed/UnknownPod lifecycle endsCleanup resourcesPod remains in terminal state
💡 Pod reaches a terminal state (Succeeded, Failed, or Unknown) and is cleaned up.
Status Tracker
Pod StateStartAfter Step 1After Step 2After Step 3After Step 4/5/6Final
podPhaseNonePendingRunningRunningSucceeded/Failed/UnknownSucceeded/Failed/Unknown
Key Moments - 3 Insights
Why does a Pod stay in Pending state for a while?
Because the Pod is waiting for the scheduler to assign it to a node and for container images to be pulled, as shown in execution_table row 2.
What causes a Pod to move from Running to Succeeded?
When all containers in the Pod exit successfully with code 0, the Pod phase changes to Succeeded, as shown in execution_table row 4.
What does the Unknown state mean for a Pod?
It means the Pod status cannot be determined, often due to node communication issues, as shown in execution_table row 6.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the Pod state right after scheduling is complete?
ARunning
BPending
CSucceeded
DCreated
💡 Hint
Check row 2 and 3 in the execution_table where Pending moves to Running after scheduling.
At which step does the Pod enter a terminal state?
AStep 3
BStep 4
CStep 7
DStep 2
💡 Hint
Look at the exit_note and row 7 where Pod is cleaned up after terminal states.
If a container crashes with an error, which Pod state will it move to?
ASucceeded
BFailed
CPending
DUnknown
💡 Hint
See execution_table row 5 where container error leads to Failed state.
Concept Snapshot
Pod lifecycle states:
- Pending: Waiting for scheduling and images
- Running: Containers running
- Succeeded: Containers exited successfully
- Failed: Containers exited with error
- Unknown: Status not known
Full Transcript
A Kubernetes Pod starts in Pending state when created. It remains in Pending while waiting for scheduling and image download. Once scheduled and containers start, it moves to Running. If containers exit successfully, Pod becomes Succeeded. If containers fail, Pod becomes Failed. If status cannot be determined, Pod is Unknown. Finally, Pod reaches a terminal state and is cleaned up. This flow helps track Pod health and lifecycle.