Liveness Probeļ
What is a āLiveness Probeā?ļ
āLiveness Probeā is a kind of health check. Kubernetes (kubelet) performs and reacts to the probes on running containers. āLiveness Probeā indicates whether the Container is running. If the āLiveness Probeā fails, the kubelet kills the Container, and the Container is subjected to its restart policy. If a Container does not provide a liveness probe, the default state is Success.
In a nutshell, returning success to a liveness probe means: āthe process is able to continue operatingā; returning failure means āthe process is unable to continue operating properly, and should be restarted to recoverā.
Why is a āLiveness Probeā necessary?ļ
For example, letās say your container is running but encounters an issue or becomes unhealthy (e.g. because a deadlock is detected). It is unable to make progress now. Restarting the container can recover it from unhealthy status. If you configure āLiveness Probeā properly, Kubernetes does it for you.