Sobes.tech
Middle+

What is the difference between liveness probe, readiness probe, and startup probe?

sobes.tech AI

Answer from AI

In Kubernetes, there are three types of probes to check the container's health:

  • Liveness Probe — checks if the container is alive. If the check fails, kubelet restarts the container. It is used to detect hung or 'dead' processes.

  • Readiness Probe — checks if the container is ready to accept traffic. If the check fails, the container is excluded from services (Endpoints), meaning no traffic is directed to it.

  • Startup Probe — used to verify the successful start of the application. If the application takes a long time to start, the startup probe prevents the container from being considered failed until it passes this check. After a successful startup probe, Kubernetes switches to using liveness and readiness probes.

Thus:

  • startup probe — for controlling the startup phase,
  • liveness probe — for controlling liveliness after startup,
  • readiness probe — for controlling readiness to accept requests.