Liveness, Readiness, and Startup Probes: Differences, failure thresholds, and avoiding probe death spirals.
Probe Architecture & Purpose
Kubernetes provides three distinct health probes executed periodically by the Kubelet. Using the wrong probe type or misconfiguring thresholds is the #1 cause of cascading cluster outages.
[ Container Starts ]
|
v
+-------------------------+
| Startup Probe | --> Protects slow-starting legacy apps from premature kills.
+-------------------------+
| (Succeeds)
+-----------------------------------+
| |
v v
+-------------------------+ +-------------------------+
| Liveness Probe | | Readiness Probe |
| (Is application alive?) | | (Can app take traffic?) |
| Failed -> Restart Pod | | Failed -> Remove from |
| | | Service Endpoints |
+-------------------------+ +-------------------------+
Comparison Matrix
| Probe Type | Purpose | Action on Failure | Ideal Target Check |
|---|---|---|---|
| Startup | Disables liveness/readiness probes until the app has finished booting. | Kills container and restarts per restartPolicy. | Checks local process initialization / schema cache. |
| Liveness | Detects deadlocks, infinite loops, and unrecoverable hangs. | Kills container and restarts Pod. | Shallow check: simple internal /healthz that does NOT check external DBs. |
| Readiness | Determines if the Pod can accept user traffic. | Keeps Pod running; removes Pod IP from Service Endpoints. | Deep check: verify DB connection pool, Redis cache warm-up. |
The Cascading "Liveness Death Spiral" Bug
Anti-Pattern: Making a Liveness Probe check the backend database (
SELECT 1 FROM users).If the database slows down under heavy load, all Liveness Probes fail simultaneously. Kubernetes kills and restarts every replica at the same time. The stampeding restart hammers the struggling database harder, causing total, unrecoverable system failure.
Best Practice: Liveness probes must only check that the internal process is responsive.