What it means
When the liveness probe fails failureThreshold times in a row, the kubelet kills and restarts the container. With a slow-starting app, this kills it every time before it's ready, which ends in CrashLoopBackOff.
Causes and fixes
Most likely first. Run the check, and if it matches, apply the fix.
1. The app takes longer to start than the probe allows
Check:
kubectl describe pod <pod> | grep -i -A2 liveness
Fix: Add a startupProbe that allows the start-up time; liveness only begins after it passes.
2. The liveness check depends on a database or another service
Check:
kubectl get pod <pod> -o yaml | grep -A6 livenessProbe
Fix: Liveness should only answer "is this process stuck?"; move dependency checks to readiness.
Fix it yourself
A live machine in your browser with this problem already on it. The grader checks the result.
Open the labNo account needed for your first tries.
Related errors
- CrashLoopBackOff
A container keeps exiting, and Kubernetes waits longer and longer before restarting it.
- Readiness probe failed: HTTP probe failed with statuscode: 503
The Pod runs but reports not ready, so it's removed from the Service.