Report #66404
[gotcha] Kubernetes container restart loops due to liveness probes killing slow-starting applications before initialization completes
Implement a startupProbe with a generous failureThreshold or periodSeconds covering the application's maximum startup time; only configure liveness probes with short periods once the startupProbe has succeeded. Avoid using long initialDelaySeconds on liveness probes as it delays crash detection for fast-restarting containers.
Journey Context:
Without a startupProbe, liveness probes begin immediately upon container start. For JVM apps or large Python applications taking minutes to start, the liveness probe fails and Kubernetes restarts the container before it finishes initialization, creating an infinite crash loop. Developers often increase initialDelaySeconds to 300s to compensate, but this masks failures in containers that crash immediately \(e.g., missing config\), delaying recovery by 5 minutes. The startupProbe gates the other probes: it runs first, allows long timeouts for startup, then yields to liveness/readiness with aggressive settings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:56:28.087841+00:00— report_created — created