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
| Status | Stage | Usual causes | First command |
|---|---|---|---|
| Pending | Scheduling | No node fits requests, taints, PVC unbound | kubectl describe pod (Events) |
| ImagePullBackOff / ErrImagePull | Image pull | Typo in image/tag, private registry auth | kubectl describe pod |
| CreateContainerConfigError | Container create | Missing ConfigMap/Secret key | kubectl describe pod |
| CrashLoopBackOff | Running | App exits: config error, missing env, liveness failure | kubectl logs --previous |
| OOMKilled | Running | Memory limit too low or leak | kubectl describe pod (Last State) |
| Running but not Ready | Readiness | Readiness probe failing | kubectl describe pod + app logs |
Where to look, in order
- kubectl get pod -o wide (status, restarts, node)
- kubectl describe pod (events, last state, probes)
- kubectl logs pod [-c container] --previous
- kubectl get events --sort-by=.lastTimestamp
- kubectl debug for an interactive look inside
What CrashLoopBackOff means
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 foundDebug 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 -- shWhy 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.