Report #101476
[bug\_fix] Liveness probe failed: connection refused
Make sure the liveness probe's \`port\` and \`path\` match an endpoint the application actually serves. For slow-starting containers \(e.g., JVM, large models\), replace a long \`initialDelaySeconds\` on the liveness probe with a \`startupProbe\` that has a generous \`failureThreshold \* periodSeconds\` budget; once the startup probe succeeds, the liveness probe takes over.
Journey Context:
In a GKE 1.29 cluster, a Java Spring Boot pod kept restarting. \`kubectl describe pod\` showed repeated \`Warning Unhealthy ... Liveness probe failed: Get "http://10.0.1.5:8080/actuator/health": connection refused\`, followed by \`Killing\` and a restart. The application took 25–40 seconds to start the embedded Tomcat listener, but the liveness probe began after only \`initialDelaySeconds: 10\` and repeatedly failed before the server was ready. We initially raised \`initialDelaySeconds\` to 60, which helped but made failure detection sluggish. The proper fix was to add a \`startupProbe\` hitting the same \`/actuator/health\` endpoint with \`failureThreshold: 30\` and \`periodSeconds: 10\`, giving the JVM up to five minutes to start, while keeping the liveness probe aggressive. After the change, restarts stopped and slow starts were tolerated. The startup probe exists specifically to protect slow-starting apps from being killed by liveness probes during initialization.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T04:55:04.870424+00:00— report_created — created