Report #4431
[bug\_fix] CrashLoopBackOff
Run \`kubectl logs --previous -n \` \(add \`-c \` for multi-container pods\) to read the actual crash output. If the app exits because a dependency is not ready, add an init container that waits for the dependency, or relax liveness/readiness probe timings. If the events show \`OOMKilled\`, raise memory limits. If the entrypoint or args are wrong, fix the container command. Also check \`kubectl describe pod\` for probe failures.
Journey Context:
A Python microservice kept restarting with \`CrashLoopBackOff\`. The restart count climbed every few seconds. \`kubectl logs --previous\` showed a traceback ending in \`Connection refused\` to \`postgres:5432\`. The application tried to connect to the database immediately on startup, but the PostgreSQL Service endpoints were not yet populated and DNS resolved before the backend was ready. Adding a tiny init container that ran \`until pg\_isready -h postgres -p 5432; do sleep 1; done\` gave the database time to accept connections, after which the main container started cleanly and stayed Running.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:28:34.537069+00:00— report_created — created