Misconfigured probes cause the exact failures they were meant to prevent. A liveness probe with a tight timeout kills a container that is merely busy, and a missing readiness probe pours traffic into a pod that has not finished booting.
I have watched a routine deploy trigger a rolling restart loop because someone copied a liveness probe from a tutorial, pointed it at an endpoint that queried the database, and set a one-second timeout. Under load the query took two seconds, the probe failed three times, the kubelet killed the container, the replacement was cold, latency rose, the next query took longer, and the cluster ate itself. Nobody had deployed a bug. They had deployed a probe. The three probe types exist to do three different jobs, and the failures come almost entirely from treating them as interchangeable. This is how to configure each one on purpose.
Three probes, three jobs
The kubelet runs three independent probes against each container, and the consequence of failure differs for each.
- Readiness gates traffic. When it fails, the pod is removed from the Service endpoints, so no new requests are routed to it. The container is not restarted. This is the probe that keeps traffic off a cold or overloaded pod.
- Liveness restarts the wedged. When it fails past its threshold, the kubelet kills the container and lets the restart policy replace it. Use it only for the state a restart actually fixes: a deadlock, an exhausted thread pool, an event loop that has stopped turning.
- Startup protects slow boots. While it is running, liveness and readiness are suspended entirely. Once it succeeds the first time, it never runs again and the other two take over.
The single most useful rule follows from those definitions: liveness should be cheaper and more forgiving than readiness. Readiness can legitimately check a downstream dependency, because taking one pod out of rotation is cheap and reversible. Liveness must not, because a slow or flapping dependency will then restart every pod at once, converting a transient downstream blip into a cluster-wide outage. Liveness answers one question — is this process still capable of doing work — and nothing more.
A three-probe spec with the timings that matter
apiVersion: apps/v1
kind: Deployment
metadata:
name: orders-api
spec:
replicas: 3
selector:
matchLabels:
app: orders-api
template:
metadata:
labels:
app: orders-api
spec:
containers:
- name: orders-api
image: registry.example.com/orders-api:1.8.2
ports:
- containerPort: 8080
# Startup: protects a slow boot. Liveness and readiness are
# suspended until this first succeeds. Budget = failureThreshold
# x periodSeconds = 30 x 5s = 150s before the container is killed.
startupProbe:
httpGet:
path: /healthz/started
port: 8080
periodSeconds: 5
failureThreshold: 30
timeoutSeconds: 2
# Readiness: gates traffic. Failing removes the pod from the
# Service endpoints; the container is NOT restarted. Fine to let
# this reflect a downstream dependency.
readinessProbe:
httpGet:
path: /healthz/ready
port: 8080
periodSeconds: 10
timeoutSeconds: 2
failureThreshold: 3
successThreshold: 1
# Liveness: restarts a wedged container. Keep it cheap and
# dependency-free so a slow downstream never causes a restart.
livenessProbe:
httpGet:
path: /healthz/live
port: 8080
periodSeconds: 10
timeoutSeconds: 2
failureThreshold: 3
The defaults are worth knowing because most bad probes are bad by omission. If you set nothing, periodSeconds is 10, timeoutSeconds is 1, failureThreshold is 3, successThreshold is 1 and initialDelaySeconds is 0. That one-second timeout is the classic trap: a probe that a busy container answers in 1.2 seconds is scored as a failure. Set timeoutSeconds explicitly to something your endpoint can meet under real load.
Note the separate endpoints. /healthz/live should confirm only that the process is responsive and return fast; /healthz/ready may check that the database connection pool and any hard dependency are available. Designing those as first-class, documented routes rather than an afterthought is exactly the discipline I argued for in spec-first API development — the health contract deserves the same care as the business one.
The startup probe fix for slow boots
Before the startup probe existed, teams protected slow-booting applications by inflating initialDelaySeconds on the liveness probe. It never worked well. Set it too low and a JVM service that spends ninety seconds warming class loading, JIT compilation and connection pools gets killed before it can serve a request, restarts, and loops forever. Set it high enough to cover the worst boot and you have blinded the liveness probe to genuine mid-life hangs for that whole window.
The startup probe separates the two concerns. Give it a generous budget — failureThreshold multiplied by periodSeconds, 150 seconds in the spec above — and the container has that long to come up. The moment /healthz/started returns 200, the startup probe stops and the liveness probe begins with its tight, unforgiving timing. Slow boot and fast hang detection, without compromise. This is the standard fix for JVM applications, and for anything else that does meaningful warm-up work — .NET, large Python workers, services that prime a cache on start.
httpGet, exec, tcpSocket and grpc
Prefer httpGet where the workload speaks HTTP. It is cheap, it is observable, and a 200 to 399 status counts as success. Reach for exec only when there is no socket to hit — a batch worker, a sidecar with no listener — and remember that exec forks a process on every period, which is the most expensive option and can itself cause CPU pressure on a busy node. For internal services already fronted by mutual TLS, keep the probe endpoint on a plain internal port or a path the kubelet can reach without a client certificate, since the kubelet is not a mesh participant. Use tcpSocket for services where a listening port is a sufficient signal, and grpc where the app implements the standard gRPC health checking protocol.
One last operational warning. Probes execute on the node, and a node under memory pressure — swapping, or starved of CPU — will make healthy containers answer probes slowly and trip liveness restarts that solve nothing and add load. If probe failures cluster on particular nodes rather than particular pods, look at the host before you touch the spec; the cause is often resource pressure on the machine, not the application.
Get the division of labour right and probes are the quietest resilience control you own. Get it wrong and they are a self-inflicted outage with a YAML footprint. Readiness gates, liveness restarts, startup waits — three probes, three jobs, and never the one doing another’s work.
Free interactive tool
Website compliance checklist
What your site has to do, based on what it actually does
Answer as much or as little as you like — the list builds as you go. Nothing is stored against your name and no email is required.
Everything that applies
Ordered by what to do first: legal requirements you can close quickly, then larger pieces of work, then what is expected rather than required. Not exhaustive, and not a legal audit.
Dated PDF, yours to keep or circulate.
Most technology problems are not technology problems. They are control problems.
The systems exist. The investment has been made. The question is whether leadership can understand, direct, evidence, and sustain what those systems produce. Find out where control exists — and where it only appears to.