Report #98206
[bug\_fix] CrashLoopBackOff: container exits immediately after pod start
Inspect the previous container logs with \`kubectl logs --previous\` to find the startup failure, then fix the application command, config, or missing dependency. If logs are empty, raise the initialDelaySeconds or add a startupProbe so the kubelet does not kill the container during slow initialization.
Journey Context:
I ran \`kubectl get pods\` and saw the pod flipping between Running and CrashLoopBackOff. \`kubectl describe pod\` showed \`Back-off restarting failed container\` but the message event only said the container exited with code 1. I tried \`kubectl logs\` and got nothing because the container had already died and been replaced. I then ran \`kubectl logs --previous\` and saw a Python traceback: the app could not import a module because of a typo in the startup command. After fixing the command in the Deployment, the pod stayed Running. In another case the app was healthy but slow to bind its port; the kubelet's default liveness probe killed it before it finished starting, which looked exactly like a crash. Adding a startupProbe with \`failureThreshold: 30\` and \`periodSeconds: 10\` gave the app enough time to initialize, and the CrashLoopBackOff stopped.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:34:50.177172+00:00— report_created — created