A Pod shows CrashLoopBackOff. What does it mean and how do you start debugging?
Options
- The container keeps crashing and restarting; read
logs --previous(Correct option) - The node is out of disk space and cannot start pods
- The image is still being downloaded from the registry
- The Service has no IP address, so the Pod cannot start
Answer
The container keeps starting and crashing; Kubernetes retries with growing delays. Check kubectl logs --previous and kubectl describe pod
Why
CrashLoopBackOff = the container starts, exits with an error, Kubernetes restarts it, and waits longer after each failure.
Typical causes: application error at startup (bad config, missing env var), cannot connect to the database, wrong command, out of memory (OOMKilled) or a failing liveness probe.
Steps: kubectl logs <pod> --previous (output of the crashed run), kubectl describe pod <pod> (events and exit code), check ConfigMap/Secret values and resource limits.
Remember
CrashLoopBackOff: read logs --previous and describe.