1.26 Kubernetes Health Probe Definition
Kubernetes Health Probes are essential mechanisms that check the health of containers, ensuring reliability and availability in cluster environments.
Kubernetes Health Probe Definition is the precise characterization of liveness, readiness, and startup probes as distinct, independently evaluated checks the kubelet performs against a container, defined by the different consequence each type of probe triggers upon failure, rather than by any difference in the underlying check mechanism they use.
Probes Defined by Consequence, Not Mechanism
Shared Check Mechanisms Across Probe Types
All three probe types are defined to use the same set of underlying check mechanisms, such as executing a command inside the container, issuing an HTTP request, or opening a TCP connection; what differentiates liveness, readiness, and startup probes is not how the check is performed but what action results from its outcome.
Consequence Is the Defining Attribute
Because the mechanisms overlap, a probe's type, and therefore its definition, is established entirely by which field it is declared under in the container specification and, correspondingly, which corrective action the kubelet takes when it fails.
Liveness Probe Defined by Restart
Failure Triggers Container Restart
A liveness probe is defined specifically by the action taken on repeated failure: the kubelet kills the container and restarts it according to the Pod's restart policy, making it the appropriate definition for detecting conditions, such as deadlocks, that a running process cannot recover from on its own.
Readiness Probe Defined by Traffic Exclusion
Failure Triggers Endpoint Removal, Not Restart
A readiness probe is defined by a distinctly different consequence: failure does not restart the container at all, but instead removes the Pod from the Endpoints or EndpointSlice backing any Service that selects it, excluding it from receiving traffic until the probe begins succeeding again.
Independent of Container Health per Se
Because readiness is defined around traffic eligibility rather than container health, a container can be defined as simultaneously alive, in the sense of passing its liveness probe, and not ready, in the sense of failing its readiness probe, without contradiction.
Startup Probe Defined by Deferral
Suspending Other Probes During Initialization
A startup probe is defined by the deferral it imposes: while it has not yet succeeded, liveness and readiness probes are not evaluated at all, preventing a slow-initializing container from being killed by a liveness probe before it has had a fair chance to finish starting up.
A Temporary, Not Permanent, Check
Once a startup probe succeeds, its definition specifies that it stops being evaluated for the remainder of the container's life, handing off entirely to whatever liveness and readiness probes are separately configured.