What does CrashLoopBackOff mean, and how do you fix it?
CrashLoopBackOff is a Kubernetes Pod status that means a container keeps exiting and the kubelet is waiting before it restarts it again. The wait starts at 10 seconds, doubles after each crash and is capped at 5 minutes. CrashLoopBackOff is a symptom, not the error itself: the cause is whatever makes the container’s process exit, and you find it in the previous container’s logs, its exit code and the Pod’s events.
What the status means
When a container in a Pod exits and the Pod’s restartPolicy is Always or OnFailure, the kubelet restarts it on the same node. If it exits again, the kubelet waits before the next attempt. During that wait the container is in the Waiting state with the reason CrashLoopBackOff, which kubectl get pods shows in the STATUS column:
NAME READY STATUS RESTARTS AGE
api-7d9c8b6f5d-x2kqp 0/1 CrashLoopBackOff 6 (2m ago) 9mThe Pod’s events show the matching warning that people often search for:
Warning BackOff kubelet Back-off restarting failed container api in pod api-7d9c8b6f5d-x2kqpThe Pod is not moved to another node and not recreated. The same container restarts in place, and the RESTARTS count grows.
How the back-off timing works
According to the Pod lifecycle documentation, the kubelet restarts exited containers “with an exponential backoff delay (10s, 20s, 40s, …), that is capped at 300 seconds (5 minutes)”. Once a container has run for 10 minutes without problems, the timer resets.
| Restart | Delay before it |
|---|---|
| 1 | 10 s |
| 2 | 20 s |
| 3 | 40 s |
| 4 | 80 s |
| 5 | 160 s |
| 6 and later | 300 s |
Two newer settings change this. With the KubeletCrashLoopBackOffMax feature, beta and enabled by default since Kubernetes 1.35, administrators can lower the cap per node with crashLoopBackOff.maxContainerRestartPeriod in the kubelet configuration, to any value from 1 to 300 seconds. The ReduceDefaultCrashLoopBackOffDecay feature, alpha since 1.33 and off by default, starts at 1 second and caps at 60 seconds.
How to find the cause
Describe the Pod and read the last termination of the failing container:
kubectl describe pod <pod>Look at
Last State: Terminated, itsReasonandExit Code, and theEventsat the bottom.Read the logs of the crashed container, not the one currently waiting:
kubectl logs <pod> -c <container> --previousList the events for the Pod if
describetruncates them:kubectl get events --field-selector involvedObject.name=<pod>If the container exits before it writes anything, start a copy of the Pod with a shell instead of the normal command and run the entrypoint by hand. The debugging documentation shows the pattern:
kubectl debug <pod> -it --copy-to=<pod>-debug --container=<container> -- sh
What the exit code tells you
Exit codes above 128 mean the process was killed by a signal: the code is 128 plus the signal number.
| Exit code | Meaning | Where to look |
|---|---|---|
| 0 | The process finished successfully, but restartPolicy: Always restarts it | The workload is a one-off task; run it as a Job |
| 1 | Generic application error | Application logs |
| 126 | Command found but not executable | File permissions, image entrypoint |
| 127 | Command not found | command and args in the Pod spec, image contents |
| 137 | Killed with SIGKILL (9), often by the out-of-memory killer | Exit code 137 and OOMKilled |
| 139 | Segmentation fault (SIGSEGV, 11) | Native code, base image libraries |
| 143 | Stopped with SIGTERM (15) | Liveness probe failures, shutdowns |
Common causes
- Missing or wrong configuration. An environment variable, Secret or config file the application expects is missing or has the wrong value, and the process exits at startup. The logs usually say so.
- A dependency is unreachable. The application cannot reach its database, message broker or the Kubernetes API at startup and exits instead of retrying. A network policy is a frequent reason; see network connectivity issues.
- Out of memory. The container goes over its memory limit and is killed, with reason
OOMKilledand exit code 137. - A liveness probe that fires too early. A slow-starting application fails its liveness probe and the kubelet kills it before it is ready. Add a
startupProbeor raise the probe’s initial delay and failure threshold. - Wrong command or arguments. A typo in
commandorargsoverrides the image entrypoint with something that does not exist. - Wrong CPU architecture. An image built only for amd64 fails with
exec format erroron an arm64 node. See handle single-platform container images. - Permissions. A container running as non-root, or with a read-only root file system, cannot write where the application expects.
- A task that ends. A script or migration exits with code 0, and the Deployment restarts it forever. It belongs in a Job.
CrashLoopBackOff vs similar statuses
| Status | What it means |
|---|---|
CrashLoopBackOff | The container started and keeps exiting |
ImagePullBackOff or ErrImagePull | The image cannot be pulled, so the container never started |
CreateContainerConfigError | A referenced Secret or ConfigMap is missing |
Pending | No node has been assigned yet; see Pods stuck in Pending |
OOMKilled | The last run ended because the container exceeded its memory limit |
Fixing it
Fix the cause and roll out a corrected version: new configuration, a fixed image or adjusted probes and limits. Deleting the Pod only creates a new one with the same problem. Once the new container runs for 10 minutes, the back-off timer resets and the restart count stops growing.