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 200–399; 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.
successThresholdmust be1for 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. terminationGracePeriodSecondscan also be set on a probe to override the Pod’s value when a failing liveness probe kills the container.