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.
kubectl get pod mypod -o jsonpath='{.status.phase}' # Output shows current Pod state
| Step | Pod State | Condition | Action | Result |
|---|---|---|---|---|
| 1 | Pending | Pod object created in cluster | Start scheduling | Pod enters Pending |
| 2 | Pending | Waiting for container images and node assignment | Schedule Pod to node | Pod moves to Running |
| 3 | Running | Containers are running | Monitor container status | Pod stays Running or moves to terminal state |
| 4 | Running | Container exits with code 0 | Mark Pod as Succeeded | Pod moves to Succeeded |
| 5 | Running | Container exits with error code | Mark Pod as Failed | Pod moves to Failed |
| 6 | Running | Status unknown due to node issues | Mark Pod as Unknown | Pod moves to Unknown |
| 7 | Succeeded/Failed/Unknown | Pod lifecycle ends | Cleanup resources | Pod remains in terminal state |
| Pod State | Start | After Step 1 | After Step 2 | After Step 3 | After Step 4/5/6 | Final |
|---|---|---|---|---|---|---|
| podPhase | None | Pending | Running | Running | Succeeded/Failed/Unknown | Succeeded/Failed/Unknown |
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
kubectl command shows the current state of all Pods in the default namespace?kubectl get pods lists Pods with their current states briefly.kubectl describe pods shows detailed info, kubectl logs shows logs, and kubectl create creates resources.kubectl get pods below, what is the current state of the Pod named web-server?
NAME READY STATUS RESTARTS AGE web-server 1/1 Running 0 5m
Pending state for a long time. Which of the following is the most likely cause?CrashLoopBackOff. What is the best first step to diagnose the problem?kubectl logs helps identify the error causing crashes.kubectl logs <pod-name> to check container logs -> Option BPass the test and this pattern moves unknown