What types of probes are available in Kubernetes (liveness, readiness, startup)? What is each for, and what happens when they trigger?
sobes.tech AI
Answer from AI
In Kubernetes, there are three main types of probes that help monitor the state of containers:
-
Liveness probe — checks if the container is alive. If the probe fails, kubelet restarts the container. It is used to detect "hung" processes.
-
Readiness probe — checks if the container is ready to accept traffic. If the probe fails, the container is temporarily removed from the services (Endpoints) so that no traffic is directed to it.
-
Startup probe — used to verify the successful start of a container. If the container does not start quickly, the startup probe reports a failure and the container is restarted. After the startup probe succeeds, liveness and readiness probes are enabled.
Thus, each probe is responsible for different stages of the container's lifecycle and helps Kubernetes manage application states more flexibly.