CrashLoopBackOff
Error message
Back-off restarting failed container
Quick summary
The container starts, crashes, and Kubernetes restarts it — this cycle repeats with increasing back-off delays.
Why this happens
The application crashes on startup due to a configuration error
A required dependency (database, API) is not available when the container starts
The liveness probe is too aggressive and kills the container before it is ready
The container's entrypoint command is incorrect
Minimal example
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 0 # too aggressivelivenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30 # give time to startThe liveness probe starts immediately (0s delay) and fails because the app is not ready. The fix gives 30 seconds for startup.
How to diagnose
Check Pod status:
kubectl get pods— look for CrashLoopBackOffView container logs:
kubectl logs <pod>andkubectl logs <pod> --previousDescribe the Pod for events:
kubectl describe pod <pod>Check if dependencies (database, config) are available and accessible
How to fix
Fix the underlying application error shown in the logs
Ensure dependencies are available before the container starts (use init containers)
Increase the liveness probe's initialDelaySeconds to give more startup time
Fix the entrypoint command in the Dockerfile or Pod spec
How to prevent
Use init containers to wait for dependencies
Set appropriate liveness probe delays for slow-starting applications
Test containers locally before deploying