Kubernetes Probe Types Reference

liveness, readiness, startup probe types with exec, httpGet, tcpSocket, gRPC.

Reference for Kubernetes container probe types — liveness, readiness, startup — with their action handlers, timing parameters and effect on traffic and restarts.

What is the difference between liveness and readiness probes?

A liveness probe decides whether to restart a container — failures kill and recreate it. A readiness probe decides whether the Pod receives traffic — failures remove it from Service endpoints without restarting it. A deadlocked but alive process needs liveness; a warming-up process needs readiness.

Kubernetes probe types

Probes are how the kubelet checks container health. There are three probe roles — liveness, readiness and startup — each able to use one of four action handlers. Getting the role and timing right is the difference between graceful rolling updates and restart storms. This reference covers all three roles, the four handlers and every timing field.

How it works

You attach a probe to a container in the Pod spec. The kubelet runs the chosen handler on periodSeconds, and after failureThreshold consecutive failures it acts according to the probe’s role:

livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
  initialDelaySeconds: 10
  periodSeconds: 5
  timeoutSeconds: 1
  failureThreshold: 3
  • Liveness failure → kubelet restarts the container.
  • Readiness failure → kubelet removes the Pod from Service endpoints (no traffic) but does not restart it.
  • Startup failure → like liveness, but while it is still passing/running the other two probes are suppressed, giving slow apps time to boot.

Success per handler: httpGet = HTTP 200399; exec = exit code 0; tcpSocket = the TCP connection opens; grpc = the standard gRPC health check returns SERVING.

Tips and notes

  • Never point a liveness probe at a dependency (database, downstream API) — a blip there will restart-loop your whole fleet.
  • successThreshold must be 1 for liveness and startup probes; only readiness may require multiple consecutive successes.
  • A startup probe’s total grace is failureThreshold × periodSeconds — size it to the worst-case boot time.
  • terminationGracePeriodSeconds can also be set on a probe to override the Pod’s value when a failing liveness probe kills the container.