Kubernetes CrashLoopBackOff: How to Fix It Fast in 2026
Fix Kubernetes CrashLoopBackOff fast: read exit codes, tell OOMKilled apart from failed liveness probes, and apply the right kubectl fix today.
By Babul Jack
A Kubernetes CrashLoopBackOff means a container keeps starting, crashing, and restarting with an exponential backoff delay between attempts. It is a status, not a root cause: to fix CrashLoopBackOff you read the container's exit code and last-state reason with kubectl describe pod, then apply one of a handful of known fixes - raise the memory limit, fix a bad config, correct a liveness probe, or repair the image or command.
In client projects I see this exact alert wake people up more than almost any other Kubernetes failure, and most of the time it takes under five minutes to diagnose once you stop guessing and start reading the signal Kubernetes already gives you.
What CrashLoopBackOff actually means
CrashLoopBackOff is reported in kubectl get pods when a container has crashed and Kubernetes' restartPolicy (Always or OnFailure by default) is restarting it, with the delay between restarts growing - 10s, 20s, 40s, up to a cap - each time it fails again. The status itself carries no information about the container died; that detail lives in the exit code and the block of the pod's container status, which is why jumping straight to "just restart it" almost never solves the real problem.
The standard diagnostic sequence, confirmed by multiple production runbooks, is always the same four commands in the same order: kubectl get pods, kubectl describe pod <pod>, kubectl logs <pod> --previous, kubectl get events. Skipping --previous is the single most common mistake - once a container has restarted, kubectl logs without that flag shows the new attempt's (often empty) log, not the crash.
Read the exit code before you touch anything
The exit code in describe pod's Last State section tells you which of a small number of failure classes you are dealing with. Here is the mapping that recurs across Kubernetes operator write-ups:
Exit code
Meaning
Where to look
Typical fix
0
Process exited cleanly, unexpected for a long-running container
Workload type
Run it as a Job, not a Deployment
1
Unhandled application error
kubectl logs --previous
Fix the bug or bad config shown in the stack trace
126
Entrypoint found but not executable
Dockerfile
chmod +x the entrypoint script
127
Command or binary not found
command/args in the pod spec
Fix the binary path or install it in the image
137
SIGKILL - almost always an out-of-memory kill
describe pod, look for OOMKilled: true
Raise resources.limits.memory or fix a leak
143
SIGTERM, graceful shutdown did not complete in time
terminationGracePeriodSeconds
Add a signal handler or extend the grace period
The two codes worth slowing down on are 137 and 143, because both come from a kill signal rather than the app choosing to exit, and they are easy to confuse.
OOMKilled (exit 137) vs a failed liveness probe (also 137/143)
OOMKilled: true in lastState means the kernel's OOM killer terminated the container because it exceeded its memory limit - this is container-level, independent of whether the node itself has memory pressure. The fix is either raising resources.limits.memory to what the workload actually needs, or fixing a memory leak if usage grows unbounded over minutes rather than spiking at startup.
A failed liveness probe produces a very similar-looking restart, but describe pod's Events section will show Liveness probe failed followed by a Killing event instead of (or alongside) OOMKilled. This is a kubelet-initiated kill, not a kernel one, and the real fix is almost always in the probe definition, not the app. The Kubernetes probes documentation is explicit that a startupProbe should guard any container that takes more than a few seconds to initialize, because liveness and readiness probes don't start until it succeeds - without one, a slow-booting app gets killed by its own liveness check before it ever finishes starting.
One detail worth knowing if you probe an existing HTTP endpoint instead of a dedicated health check: the kubelet stops reading an httpGet probe's response body after 10KiB and judges success purely on the status code, so a large response body can produce connection reset by peer noise in your app logs that looks like a network problem but is actually the probe closing the connection early.
Step-by-step: diagnosing a CrashLoopBackOff
List the pod and confirm the status.kubectl get pods - note the restart count, not just the status string; a climbing restart count on a pod that currently shows Running is an early warning before it flips to CrashLoopBackOff.
Describe the pod.kubectl describe pod <pod> - read Last State, Reason, the exit code, and the Events section at the bottom in that order.
Read the previous container's logs.kubectl logs <pod> --previous (or -c <container> in a multi-container pod) - this is the only place you will see the stack trace or config error that caused exit code 1.
Check resource usage over time.kubectl top pod --containers - a container that OOMs seconds after starting has a limit set too low; one that OOMs after several minutes usually has a leak.
Check dependencies. A pod crashing with exit code 1 immediately on boot because it can't reach a database or Redis instance logs a connection error, not a Kubernetes error - fix the dependency or the environment variable pointing at it, not the pod spec.
Apply the targeted fix from the exit-code table above, then watch kubectl get pods -w through at least two restart cycles before declaring it fixed.
Checklist before you redeploy
Both resources.requests and resources.limits are set for memory, not just one
A startupProbe exists for any container with a non-trivial boot time
The image tag is pinned to a digest, not a mutable tag like :latest
terminationGracePeriodSeconds is long enough for the app's actual shutdown work
Liveness probes hit an internal health endpoint, never an external dependency
Why this keeps recurring in 2026 deployments
Three patterns show up repeatedly in the 2026 operator guides I read while researching this: liveness probes pointed at endpoints that transitively check a database, which turns a 30-second database blip into a fleet-wide restart storm; memory limits copy-pasted from a different service's manifest; and init containers failing silently because their own exit code isn't surfaced the same way as the main container's. None of these are Kubernetes bugs - they are manifest and probe design mistakes that the platform faithfully enforces.
If your team is migrating services onto Kubernetes or hardening an existing cluster's deploy pipeline, this is exactly the kind of production-readiness review I do as part of web app development engagements - catching missing startup probes and unpinned image tags before they page someone at 3 a.m. is cheaper than debugging them live.
It's also worth tying this into the rest of your production error-handling story. If your app crashes because a downstream Postgres pool is exhausted rather than because of a bad probe, the fix lives in the database layer, not the pod spec - see my post on fixing Postgres too many connections errors for that side of it. And if the crashing container is a Node.js service, pair the exit-code triage here with handling unhandled promise rejection crashes in Node.js, since an uncaught rejection is one of the most common reasons for a clean exit code 1.
Frequently asked questions
How do I fix CrashLoopBackOff caused by OOMKilled?
Confirm OOMKilled: true in kubectl describe pod's Last State, then either raise resources.limits.memory to match real usage measured with kubectl top pod --containers, or fix the memory leak if usage grows steadily rather than spiking at boot.
Why does kubectl logs show nothing useful during a crash loop?
Because once the container restarts, plain kubectl logs <pod> shows the new attempt's output, which may be empty if it crashes before logging anything. Add --previous to read the logs from the crashed attempt instead.
What is the difference between exit code 137 and 143?
Both come from a kill signal rather than the app exiting on its own: 137 is SIGKILL (128+9), most often an OOM kill or a hard-timeout kubelet kill; 143 is SIGTERM (128+15), meaning the app got a graceful shutdown signal and failed to exit within terminationGracePeriodSeconds.
Can a bad liveness probe cause CrashLoopBackOff on a healthy app?
Yes. If the probe points at the wrong port or path, or checks an external dependency, the kubelet will kill and restart an otherwise-working container. Fix the probe target or path, and use a startupProbe so slow-booting apps aren't killed before they finish initializing.
Does raising the memory limit always fix OOMKilled?
Only if the node has the spare capacity - raising a limit without checking node allocatable memory can push the pod into Pending instead. If usage keeps climbing over time rather than stabilizing, the real fix is finding and closing the leak, not raising the limit again.
Key takeaways
CrashLoopBackOff is a status, not a cause - always read the exit code and lastState.reason in kubectl describe pod before changing anything.
Exit code 137 with OOMKilled: true is a memory limit problem; exit code 137/143 with a Liveness probe failed event is a probe design problem - they look alike but need different fixes.
kubectl logs --previous is the only way to see the crashed attempt's log once a restart has happened.
Add a startupProbe to any container with meaningful boot time so liveness checks can't kill it mid-initialization.
Pin image tags to a digest and set both resources.requests and resources.limits for memory to avoid the most common causes of crash loops in 2026 deployments.