Use it when pods restart repeatedly or are never Ready.
Liveness, Readiness and Startup Probes
Probes report container health: liveness (restart if failing), readiness (remove from Service endpoints if failing) and startup (delay other probes while starting).
1. kubectl describe pod — probe failure events.
2. Probe path/port/command correct?
3. Timeouts and thresholds realistic?
4. Test the endpoint from inside: kubectl exec <p> -- wget -qO- localhost:<port>/health.
5. Adjust probes.
kubelet runs probes → readiness gates endpoints → liveness restarts
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 How to verify Verify boundary
Make the readiness endpoint check what the Pod needs to serve. Keep liveness simple so a slow dependency does not restart healthy Pods. Size startup probes to the slowest normal start.
Step 2 Common failures Narrow the fault
A liveness probe that checks the database restarts every Pod when the database is slow. A probe timeout of 1 second fails under load. Without a startup probe, slow starts are killed by liveness in a loop.
Liveness should check only the process itself, not dependencies — otherwise outages cascade. Use startupProbe for slow starts. Readiness controls traffic during rollouts.
kubectl exec <p> -- wget -qO- localhost:<port>/health— first check for this topickubectl get pods -o wide— pods, status, node, IPkubectl describe pod <pod>— events and conditionskubectl logs <pod> [-c <c>] [--previous]— container logs (incl. previous crash)kubectl get events --sort-by=.lastTimestamp— recent cluster events
ReferenceWhat it is1 section · depth on demand
How it works
The kubelet runs HTTP, TCP, gRPC or exec probes on a schedule (periodSeconds) with timeoutSeconds and failureThreshold. Readiness state is reported to the API and used by Services; liveness failures trigger a container restart.
ReferenceImportant terms & boundaries3 sections · depth on demand
Probe types
| Probe | Failing means |
|---|---|
| startupProbe | Container still starting; other probes wait |
| readinessProbe | Remove from Service endpoints (no restart) |
| livenessProbe | Restart the container |
readinessProbe: { httpGet: { path: /ready, port: 8000 }, periodSeconds: 5 }
livenessProbe: { httpGet: { path: /healthz, port: 8000 }, initialDelaySeconds: 10, failureThreshold: 3 }
Documented example, not captured output. Liveness should not check dependencies (database), or a database outage restarts every Pod.
In depth
Timing arithmetic
A probe fails after failureThreshold × periodSeconds of consecutive failures. With the defaults (periodSeconds: 10, failureThreshold: 3, timeoutSeconds: 1) a liveness probe restarts a container about 30 seconds after it stops answering.
A startup probe allows failureThreshold × periodSeconds for start-up, for example 30 × 10 s = 5 minutes; liveness and readiness are not run until it succeeds once.
What each probe should check
| Probe | Should check | Should not check |
|---|---|---|
| Startup | App finished initialising (migrations, cache warm-up) | — |
| Readiness | Can serve requests now (including required local resources) | Shared dependencies whose outage would empty every Pod at once |
| Liveness | Process is not stuck (deadlock, event loop hung) | Databases or downstream APIs |
Worked example
startupProbe:
httpGet: { path: /healthz, port: 8080 }
periodSeconds: 10
failureThreshold: 30
readinessProbe:
httpGet: { path: /ready, port: 8080 }
periodSeconds: 5
failureThreshold: 2
livenessProbe:
httpGet: { path: /healthz, port: 8080 }
periodSeconds: 10
timeoutSeconds: 2
failureThreshold: 3
Reading probe failures
kubectl describe pod web-7c… | grep -A3 -E 'Liveness|Readiness|Unhealthy'
# Warning Unhealthy Readiness probe failed: HTTP probe failed with statuscode: 503
Readiness failures remove the Pod from Service endpoints without restarting it; liveness failures show as restarts with Last State: Terminated, Reason: Error (or Completed) and exit code 137 or 143.
Common mistakes
- Liveness probes that kill slow-starting apps (use startup probes).
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.