Debugging Kubernetes Pods: CrashLoopBackOff, ImagePullBackOff, Pending and OOMKilled

A practical guide to diagnosing failing pods: reading events and logs, CrashLoopBackOff, ImagePullBackOff, Pending pods, OOMKilled and kubectl debug.

Published December 2, 2026

Every Kubernetes user eventually stares at a pod stuck in CrashLoopBackOff, Pending or ImagePullBackOff. These statuses look cryptic, but each points to a specific stage of the pod lifecycle, and a handful of kubectl commands reveal the cause almost every time.

The concept

Start with kubectl get pods to see the status and restart counts, then kubectl describe pod for events (scheduling decisions, image pulls, probe failures, OOM kills) and kubectl logs for application output. For a crashing container, kubectl logs --previous shows the logs from the last failed run, which is usually where the real error is.

Status names map to stages. Pending means the pod is not scheduled yet (insufficient resources, node selectors, taints, unbound PVCs). ImagePullBackOff means the node cannot pull the image (wrong name or tag, missing registry credentials). CrashLoopBackOff means the container starts and exits repeatedly (application error, bad config, failing liveness probe). OOMKilled means the container exceeded its memory limit.

Status → cause → command

StatusStageUsual causesFirst command
PendingSchedulingNo node fits requests, taints, PVC unboundkubectl describe pod (Events)
ImagePullBackOff / ErrImagePullImage pullTypo in image/tag, private registry authkubectl describe pod
CreateContainerConfigErrorContainer createMissing ConfigMap/Secret keykubectl describe pod
CrashLoopBackOffRunningApp exits: config error, missing env, liveness failurekubectl logs --previous
OOMKilledRunningMemory limit too low or leakkubectl describe pod (Last State)
Running but not ReadyReadinessReadiness probe failingkubectl describe pod + app logs

Where to look, in order

  1. kubectl get pod -o wide (status, restarts, node)
  2. kubectl describe pod (events, last state, probes)
  3. kubectl logs pod [-c container] --previous
  4. kubectl get events --sort-by=.lastTimestamp
  5. kubectl debug for an interactive look inside
The debugging sequence.

What CrashLoopBackOff means

kubeletContainerBackoff timerstartexit code 1 after 2 swait 10 sstart againexit code 1wait 20 s, 40 s… up to 5 min
CrashLoopBackOff is the kubelet backing off between restarts.

Practical examples

Read the crash reason

Exit codes and previous logs tell the story.

kubectl get pod api-7d9c8 -o jsonpath='{.status.containerStatuses[0].lastState.terminated}'
kubectl logs api-7d9c8 --previous --tail=50
# exit code 137 = killed (often OOM); 1 = app error; 127 = command not found

Debug a distroless or crashing container

Attach an ephemeral debug container sharing the pod's namespaces.

kubectl debug -it api-7d9c8 --image=busybox:1.36 --target=api -- sh
# or copy the pod with a different command to keep it alive:
kubectl debug api-7d9c8 -it --copy-to=api-debug --container=api -- sh

Why is my pod Pending?

The scheduler explains itself in events.

kubectl describe pod worker-5f6 | sed -n '/Events/,$p'
# 0/6 nodes are available: 3 Insufficient memory, 3 node(s) had untolerated taint {gpu: true}

Common mistakes

  • Reading only current logs of a crash-looping container instead of --previous.
  • Deleting pods repeatedly hoping the problem goes away.
  • Raising memory limits without checking for a memory leak.
  • Ignoring events, which usually state the exact cause.

Key takeaways

  • Each status points to a lifecycle stage: scheduling, pull, create, run, ready.
  • describe (events) and logs --previous solve most cases.
  • Exit code 137 often means OOM or a SIGKILL.
  • Use kubectl debug for interactive investigation.

FAQ

How long does CrashLoopBackOff wait?

The delay doubles after each failure up to five minutes and resets after the container runs successfully for a while.

Why does my container exit immediately with no logs?

Often the command is wrong (exit 127), the entrypoint script fails before logging, or the process runs in the background and the main process exits.

Can I see events after the pod is gone?

Events are kept only for a limited time (about an hour by default); ship them to your logging system for history.

More DevOps articles