Liveness probes in Kubernetes check container health, automatically restarting unresponsive applications to maintain availability without manual intervention.
In Kubernetes, liveness probes periodically check whether a container is still running correctly. If a probe fails, Kubernetes kills and restarts the container, restoring application availability without manual intervention.
NAME READY STATUS RESTARTS AGEnginx-pod 0/1 Completed 1 1d
Each time the container exits unexpectedly, the RESTARTS count increments. However, if an application stays running but becomes unresponsive (for example, trapped in an infinite loop), Kubernetes still considers it healthy—until you explicitly tell it how to check deeper.
Without a liveness probe, Kubernetes cannot detect hung or unresponsive applications that have not exited.
By leveraging these probe types, you ensure Kubernetes can detect both crashed and unresponsive containers, automatically restoring service availability.