The status of a pod depends on a few things
A pod has a phase...
Pending means the pod has been accepted by the system, but one or more of the containers has not been started. This includes time before being bound to a node, as well as time spent pulling images onto the host.
Running means the pod has been bound to a node and all of the containers have been started. At least one container is still running or is in the process of being restarted.
Succeeded means that all containers in the pod have voluntarily terminated with a container exit code of 0, and the system is not going to restart any of these containers.
Failed means that all containers in the pod have terminated, and at least one container has terminated in a failure (exited with a non-zero exit code or was stopped by the system).
Unknown means that for some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.
A pod has N containers where N >= 1. Each container has a status
Various events can happen during the lifetime of a pod. e.g.
- downloading the docker image
- mounting volumes for the pod
- running init containers
A pod has N conditions which are boolean flags. Mostly they indiciate lifecycle things. e.g.
- Scheduled
- Initialized
- Ready
So the list of statuses, trying to combine those together is
The natural order of statuses things go through:
- Pending
- Scheduled
- Initialized
- Running
- Ready
Then if the pod finishes
- Terminating
- Succeeded
- Failed
- Unknown
When watching a well behaved Pod for a very long time it will cycle through these until its removed...
- Pending
- Scheduled
- Initialized
- Running
- Ready
- Terminating
After Terminating its gone, so has no state.
From a UI I'm not sure there's huge value in differentiating Pending
from Scheduled
- it generally means 'its gonna show up somewhere soon'.
Also Succeeded
and Failed
means the pod was running once and now is not any more.
The biggie is Ready
which means the process is running and k8s has deemed it ready according to liveness / readiness checks. Otherwise Running
is the next best thing; its almost ready.