Health checks are control-plane primitives that allow an orchestrator to manage the lifecycle and traffic-readiness of a containerized process.
Kubernetes implements three distinct probe types to manage the failure domain.
| Probe Type | Question Answered | Failure Action | Failure Context |
|---|---|---|---|
| Startup | Is the app still bootstrapping? | Hold off other probes. | Slow migrations, cache warm-up. |
| Liveness | Is the process deadlocked? | Restart Container. | In-memory corruption, thread deadlock. |
| Readiness | Can the app handle traffic? | Remove from Service. | Dependency down, saturated IO. |
The Liveness probe must be minimalist. Querying an external database in a liveness probe is an anti-pattern: if the DB is down, all replicas restart simultaneously, inducing a cluster-wide outage.
Instead of binary "up/down" thresholds, advanced systems (Akka, Cassandra) use the \phiAccrual Failure Detector. It calculates the probability of failure based on the history of heartbeat inter-arrival times.
Mathematical Model: IfT_{last}is the time of the last heartbeat,\phiis defined as:
A naive health check configuration can induce a "Thundering Herd" during recovery.
Mitigation:
For complex health logic (e.g., checking multiple internal subsystems), move the logic to a Health Sidecar.
/healthz endpoint must not have side effects.timeoutSeconds must be shorter than the periodSeconds.failureThreshold: 3 to absorb transient network jitter.