Report #745
[bug\_fix] CrashLoopBackOff: container exits immediately after starting
Inspect the previous container logs with \`kubectl logs --previous\` and \`kubectl describe pod \` to find the actual exit reason. Common fixes: correct a missing required environment variable, fix a config file path, change the bind address from \`localhost\`/\`127.0.0.1\` to \`0.0.0.0\`, or remove a failing startup/liveness probe. Then rebuild/redeploy the fixed image or manifest.
Journey Context:
You deploy a new microservice and the pod flips between Running and CrashLoopBackOff. \`kubectl get pods\` shows restart counts climbing. \`kubectl describe pod\` only reports Back-off restarting failed container. The real reason is in the previous container's logs, which are deleted on restart unless you use --previous. You run \`kubectl logs mypod-xxx --previous\` and see a stack trace: the app tries to connect to localhost:8080 health endpoint but bound to 127.0.0.1 inside the container, so the liveness probe \(which hits the pod IP\) connection-refuses and Kubernetes kills the container. The container then exits on SIGTERM, not on its own bug, creating a loop. After changing the bind address to 0.0.0.0 the pod stabilizes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T12:53:15.869238+00:00— report_created — created