Skip to main content
Kubernetes coreLesson 5 of 13

How a Pod Starts

After you run a single kubectl apply, what happens inside the cluster before a container is actually running? Follow it one step at a time.

Pod statusnone
Assigned node—
Elapsed (example)~10 ms
Control planeWorker node · node-2UserkubectlAPI serverentry for all requestsetcdcluster state storeControllersDeployment·RSSchedulerpicks a nodekubeletnode agentRuntimecontainerdnginxPodRegistrye.g. Harborkubectl apply
RequestResponse / reportWatchAppears in a later step

What you will learn

  • Why the API server is the entry point for every request
  • Why "created" is not the same as "running"
  • How controllers and the scheduler work by watching
  • Where Pending and ImagePullBackOff come from
  • Where "Running" in kubectl get pods comes from

Status and where it stopped​

Status in kubectl getStep it stopped atCommon causes
Pending4. Pick nodeNot enough node resources, no node matches the placement rules
ImagePullBackOff6. ImageTypo in image name or tag, registry auth or access failure
CrashLoopBackOffAfter 7. RunContainer keeps exiting right after start (config or code error)

Try it yourself​

kubectl create deployment try-nginx --image=nginx --replicas=3 # Throwaway Deployment
kubectl get rs -l app=try-nginx # ReplicaSet the controller created
kubectl get pods -l app=try-nginx -o wide -w # Pending → ContainerCreating → Running
kubectl describe pod <pod> # Events: Scheduled, Pulling, Started
kubectl delete deployment try-nginx # Clean up

Check yourself

  1. A new Pod has stayed Pending for a long time. At which step did it most likely stop?
  2. kubectl apply has just answered "created" for a Deployment of 3 nginx Pods. What exists at that moment?
  3. In an air-gapped network, a Pod shows ImagePullBackOff. What is the most likely cause?

Further reading: Kubernetes Overview · Pod Lifecycle · Debug Pods