When updating a Kubernetes RollingUpdate deployment, kubectl get pods
shows some of the pods spend a few minutes in the ContainerCreating
state before moving to Running
. Unfortunately, the official documentation on pod states doesn't include this as a documented state. Even the kubernetes codebase has only two mentions of the term, and neither has any sort of explanatory comment.
I've been doing some adjustments to the rolling update deployment configuration value (maxUnavailable
and maxSurge
) and the probe configuration (initialDelaySeconds
), and I'm unsure if the container startup time that these values are affecting is part of ContainerCreating
or another state.
The
ContainerCreating
state is applicable when the number of containers equals or is smaller than 0.Comprehensive
According to the code snippet that is defined in the question the
ContainerCreating
status seems to be thedefault waiting state
. Only if thehasInitContainers
istrue
thedefaultWaitingState
will becomePodInitializing
. This is also indicated by the test that is mentioned as well in the question. In case ofwithout-old-record
,with-old-record
orsomething else
theContainerState
will beReason: startWaitingReason,
i.e."ContainerCreating"
hasInitContainers
https://github.com/kubernetes/kubernetes/blob/427dfd5ce1483ead29568bf7c05a98c4c0ad081c/pkg/kubelet/kubelet_pods.go#L1256