Fix pods that won't start

DevOps, Hands On40 minutesFreeSteps checked 23 November 2026By Cloud Hands On

In this task you'll find out why a pod won't start, from its status, events and logs.

Most broken pods show a reason in kubectl get pods. ImagePullBackOff / ErrImagePull: the image name or tag is wrong, or the node can't sign in to the registry. CreateContainerConfigError: a ConfigMap, Secret or key the pod refers to doesn't exist. CreateContainerError and RunContainerError: the runtime couldn't create or start the container, for example a command that isn't in the image or a bad mount.

CrashLoopBackOff means the container starts, then exits, again and again, with longer and longer waits (up to 5 minutes). Read what the crashed run printed: while the pod waits to restart, plain kubectl logs shows that run; once it's running again, add --previous. OOMKilled means it used more memory than its limit, so the kernel killed it (exit code 137). Always use the same order: get, describe (events), logs --previous.

Example. Tollmere Logistics' tracking API showed CreateContainerConfigError after a release. kubectl describe said: couldn't find key DB_HOST in ConfigMap tracking-config. The new release renamed the key; the ConfigMap still had the old name.

Before you start

You need: Docker Desktop and kind on your computer (both free). Time: 40 minutes.

Where to look

  1. Terminal
  2. kubectl

Steps

  1. Break it on purpose: create a deployment with image nginx:does-not-exist, and see ImagePullBackOff in kubectl get pods.
  2. Break it another way: refer to a key that's missing in a ConfigMap (configMapKeyRef), and read the CreateContainerConfigError message with kubectl describe pod.
  3. Make it crash: use busybox with the command sh -c 'echo starting; exit 1', then run kubectl logs <pod> (and --previous if it has started again).The kubelet keeps only one stopped run, so --previous can fail while the pod is waiting.
  4. Make it run out of memory: set a 20Mi limit and run a memory hog, then find OOMKilled and exit code 137 in kubectl describe.
  5. For each one, write down the one line that told you the cause.

Commands

kubectl get pods
kubectl describe pod <pod> | sed -n '/State:/,/Ready:/p;/Events:/,$p'
kubectl logs <pod> --previous
kubectl get pod <pod> -o jsonpath='{.status.containerStatuses[0].lastState.terminated.reason}'

Watch out for

Cost
Free on kind.
Security
Don't print Secret values while debugging; kubectl describe shows only their key names, which is all you need.
Common mistakes
Restarting or deleting the pod before reading --previous logs and events, which throws the evidence away.

Clean up

Delete the broken deployments.

Words to know

CrashLoopBackOff
The container keeps exiting after it starts, and Kubernetes waits longer between each restart.
OOMKilled
The container used more memory than its limit, so the kernel killed it (exit code 137).
CreateContainerConfigError
The pod refers to a ConfigMap, Secret or key that doesn't exist.
ImagePullBackOff
The node can't pull the image, because of a wrong name or tag or missing registry access, and is backing off.

Tick off each step and track your progress in the guide.

Open this task in DevOps, Hands On

Keep going