1. Kubernetes Probes: The Restart Storm That Was Only a Slow Cache

Kubernetes probes are three separate contracts between a container and the kubelet, and confusing them is the fastest way to turn monitoring into an outage. Startup probes judge booting, readiness probes judge traffic fitness, and liveness probes judge whether the process is stuck beyond self-recovery. Each failure triggers a different action.

Consider an illustrative composite incident. A payments service loads a pricing cache at boot, taking about ninety seconds on cold nodes. Its liveness probe starts checking after five seconds and fails three times while the cache loads, so the kubelet kills the container mid-boot. The replacement repeats the cycle. The service never becomes ready, dashboards show a restart storm, and the application code is entirely healthy. The probe configuration is the outage.

The pattern generalises. Probes fail in production not because the mechanism is fragile but because teams assign the wrong question to the wrong probe, check dependencies in the wrong place, or copy timing values that were tuned for a different workload. Every probe incident in this guide traces back to one of those three decisions.

The sections ahead build the model mechanism first: what the kubelet does on each failure, how the timing fields combine into real budgets, which handler fits which workload, and how to read Unhealthy and Killing events as evidence. The goal is probe settings that catch real deadlocks without manufacturing restart loops.


2. Kubernetes Probes Explained: Three Questions, Three Actions

Kubernetes probes answer three different questions, and the kubelet action on failure is what separates them. Startup failure restarts the container after its budget expires. Readiness failure removes the pod from Service endpoints without restarting anything. Liveness failure kills and restarts the container. Choosing a probe means choosing an action, not just a check.

Startup probes exist to protect slow booting. Until the startup probe succeeds once, the kubelet does not run liveness or readiness probes at all, so a container that needs minutes to load models, warm caches, or run migrations gets that time without being judged by faster checks. Once startup succeeds, it never runs again for that container, and the other two probes take over.

Readiness probes gate traffic. A failing readiness probe marks the pod not ready, the endpoint controller removes its address from EndpointSlices, and the Service stops sending it requests. The container keeps running, which makes readiness the right place for temporary conditions: dependency unavailable, cache cold, or graceful drain in progress. When the probe passes again, traffic returns automatically.

Liveness probes are the bluntest tool. Repeated failure means the kubelet kills the container and restarts it under the pod restart policy, incrementing the restart count. That action only helps when the process is wedged in a state a restart clears, such as a deadlock. Using liveness for anything a restart cannot fix converts a temporary condition into a restart loop. The pod lifecycle guide maps these probe actions onto pod phases and conditions.


3. Kubernetes Probes Timing: Turning Fields Into Real Budgets

Kubernetes probes timing fields combine into budgets, and most probe incidents are budget arithmetic errors. The startup budget is failureThreshold multiplied by periodSeconds. The liveness detection time is roughly the same product. timeoutSeconds caps each single attempt, and initialDelaySeconds only postpones the first check without changing any budget.

Defaults are aggressive. periodSeconds defaults to ten, timeoutSeconds to one, failureThreshold to three, and successThreshold to one. A one-second timeout is the silent killer in many manifests: a healthy endpoint answering in 1.2 seconds under load counts as failed, and three such answers restart the container. Under CPU throttling, even trivial handlers can exceed one second, which is why probe failures often correlate with node pressure rather than application bugs.

yaml
startupProbe:
  httpGet:
    path: /healthz
    port: 8080
  periodSeconds: 5
  failureThreshold: 36
livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
  periodSeconds: 10
  timeoutSeconds: 3
  failureThreshold: 3
readinessProbe:
  httpGet:
    path: /readyz
    port: 8080
  periodSeconds: 5
  timeoutSeconds: 3
  failureThreshold: 2

The example gives startup a three-minute budget, liveness a thirty-second detection window, and readiness a ten-second traffic-removal window. Those numbers are illustrations, not defaults to copy: measure real boot time and real endpoint latency, then set budgets with headroom over the slow tail. initialDelaySeconds is largely obsolete once a startup probe exists, because the startup probe already holds the other probes back; keeping a large initial delay on liveness only delays deadlock detection after boot.

successThreshold is the quiet field in most manifests. It defaults to one and must stay one for liveness and startup, but readiness can use a higher value to require consecutive successes before traffic returns. That damps endpoint flapping when an endpoint oscillates around the timeout boundary. The cost is slower return to service after recovery, which is usually the right trade for services whose readiness signal is noisy under load.


4. Kubernetes Probes Handlers: HTTP, TCP, Exec, and gRPC

Kubernetes probes support four handlers, and the handler choice decides what evidence the kubelet collects. HTTP probes send a GET and treat status codes from 200 to 399 as success. TCP probes only prove a socket accepts a connection. Exec probes run a command inside the container. gRPC probes use the standard health checking protocol.

HTTP is the default for web services because it exercises the real serving path, including the framework and middleware. Its weakness is cost and coupling: an HTTP probe that renders a page or queries a database measures far more than process health. Keep probe endpoints cheap, dedicated, and free of downstream calls unless the probe type explicitly wants dependency evidence, which only readiness sometimes does.

TCP probes fit non-HTTP servers such as databases and message brokers, but they prove little: a process can accept connections while deadlocked internally. Exec probes fit containers without a network listener, such as batch workers checking a heartbeat file, but each exec forks a process in the container and inherits its resource pressure. A slow exec probe under CPU throttling fails for scheduling reasons, not application reasons.

gRPC probes suit services that already implement the health protocol, returning serving or not-serving per service name. Whichever handler is chosen, the probe endpoint is production code: it needs the same care as any other handler, including authentication exceptions so the kubelet, which sends no credentials, is not rejected by the application's own auth middleware. Probe 401 responses are a recurring self-inflicted failure in locked-down services. Log probe-path responses separately from user traffic so health-check noise never drowns real request errors in dashboards.

Separate probe listeners are worth considering for high-throughput services. When health checks share the main request listener, a saturated connection pool or a blocked worker pool can delay probe responses even though the process is healthy. A dedicated management port with its own small thread pool isolates health evidence from request-path saturation and makes probe latency a cleaner signal. The trade-off is operational: the management port must stay reachable by the kubelet, excluded from public exposure, and covered by the same NetworkPolicy review as the main port.


5. Kubernetes Probes and Endpoints: Why Readiness Removes Traffic

Readiness failures in Kubernetes probes act through endpoints, not through the container. When readiness fails, the pod's ready condition flips to false, the endpoint controller removes the pod address from EndpointSlices, and kube-proxy and ingress controllers stop routing new requests to it. The container is untouched, which is why a pod can show READY 0/1 with zero restarts.

That separation makes readiness the correct tool for dependency-aware gating. A service that cannot reach its database should stop receiving traffic, because requests would fail anyway; removing it from endpoints lets healthy replicas absorb load and lets the affected pod recover without a restart. The same dependency check inside liveness would restart every replica simultaneously when the database hiccups, converting a dependency outage into a full restart storm.

Endpoint removal has a detection cost. With periodSeconds five and failureThreshold two, a pod leaves endpoints after roughly ten seconds of failing checks, plus endpoint propagation time. Traffic during that window still reaches the failing pod. Tightening readiness timing shortens the window but increases flapping risk under transient slowness; successThreshold above one damps flapping on the way back in, at the cost of slower return to service.

When every pod fails readiness, the Service has no endpoints and clients see connection failures or 503 responses from the ingress layer. That symptom looks like a networking outage but is usually a probe or dependency problem. The service no-endpoints troubleshooting guide works that symptom from the Service side, while this guide works it from the probe side.

Do not confuse readiness probes with readiness gates. Readiness gates let external controllers hold a pod out of endpoints until conditions they manage are satisfied, such as load balancer registration. A pod can pass its readiness probe and still be held by a gate, or fail its probe while every gate is satisfied. When endpoints are missing, check both the probe-driven ready condition and any gate conditions on the pod, because fixing the probe does nothing for a gate held by an external system.


6. Kubernetes Probes and Liveness: Restart Only What Restart Fixes

Liveness failures in Kubernetes probes restart the container, so liveness checks must only assert conditions that a restart actually repairs. Deadlocks, wedged event loops, and corrupted in-process state qualify. Dependency outages, slow downstream calls, and temporary overload do not, because the restarted container returns to the same conditions and fails again.

The dependency-check trap is the most damaging pattern. A liveness endpoint that queries the database fails for every replica when the database is briefly unavailable. The kubelet restarts all of them, they boot into the same outage, and the restart cycle continues until the database recovers, now with cold caches and a thundering herd of reconnections. Readiness would have handled the same event by pausing traffic and resuming cleanly.

Design liveness endpoints to be shallow and local: the process can accept work, its main loop is turning, and no internal invariant is broken. A separate readiness endpoint carries dependency evidence. Sharing one endpoint between both probes forces a choice between restarting on dependency failure and serving traffic while unready, and both outcomes are wrong. Two endpoints cost little and remove the dilemma.

Restart storms also hide real bugs. A container restarted every minute produces noisy logs, resets in-memory diagnostics, and can mask a memory leak that would otherwise present as a slow climb. When liveness fires repeatedly, treat the probe configuration as a suspect alongside the application. The CrashLoopBackOff troubleshooting guide covers the restart-loop evidence trail once probes are exonerated.

A useful review question cuts through most liveness debates: if this check fails at 03:00, will a restart make the next minute better? If the honest answer is that the container will return to identical conditions, the check belongs in readiness or nowhere. Liveness earns its restart only when the failure state lives inside the process and dies with it. Applying that single test during manifest review prevents the majority of probe-caused outages before they ship.


7. Kubernetes Probes for Slow Starters: Startup Budgets That Hold

Startup probes in Kubernetes probes exist because initialDelaySeconds cannot express a boot budget honestly. A fixed delay either kills slow boots on cold nodes or delays deadlock detection on fast ones. The startup probe replaces the guess with a budget: failureThreshold multiplied by periodSeconds is the maximum time the container may take to become healthy before the kubelet restarts it.

Size the budget from measured boot time on the slowest realistic node, including image pull after scheduling, cache warming, and migration steps, then add headroom for node pressure. A service that boots in forty seconds typically and ninety seconds at p99 wants a budget around three minutes, not ninety seconds. An undersized budget recreates the restart storm the startup probe was meant to prevent, just with a longer period.

yaml
startupProbe:
  httpGet:
    path: /healthz
    port: 8080
  periodSeconds: 5
  timeoutSeconds: 3
  failureThreshold: 36

The startup endpoint should report success only when the application can actually serve, or at least when its slow phase is complete. Reporting success at process start defeats the purpose, because liveness then judges a still-warming container. Reporting success only after full readiness is also fine; the startup probe hands off to readiness, which continues gating traffic until dependencies settle.

Slow starters also interact with rollouts. A Deployment with a long startup budget takes longer to prove new pods healthy, so rollout progress slows and maxUnavailable settings matter more. Pair the startup budget with sensible rollout parameters rather than shrinking the budget to make deploys feel faster. The zero-502 rollouts guide covers rollout settings that respect slow-starting pods.

Measure boot time as a distribution, not a single staging run. Record time from container start to first successful startup probe across nodes, node ages, and image-cache states, then size the budget from the slow tail. Cold nodes pull images and warm caches more slowly, and a budget tuned on a warm developer cluster fails exactly during node replacement or scale-up, when new pods are needed most. Revisit the budget after major dependency or model-size changes, because boot time drifts upward quietly as applications accumulate startup work.


8. Kubernetes Probes Decision Table: Which Probe Owns Which Signal

A decision table keeps Kubernetes probes honest by assigning each observable signal to exactly one probe. If a signal appears in two probes, one of them is wrong. Work through the signals a service can emit and place each row deliberately instead of copying a manifest from another service.

Signal Owning probe Reason
Process finished booting and slow phase complete Startup Gates the other probes until boot completes
Main loop wedged, restart would clear it Liveness Only restart repairs this state
Database or cache dependency unavailable Readiness Traffic should pause; restart cannot fix the dependency
Cache cold after restart Readiness Pod should warm before receiving traffic
Graceful drain in progress Readiness Endpoints removal stops new requests before shutdown
Internal invariant broken beyond recovery Liveness Restart is the designed remedy
Temporary overload, shedding load Readiness Removing traffic lets the pod recover in place
Deadlock in a worker thread Liveness Process cannot self-recover

Two rows cause most production damage when misplaced. Dependency availability inside liveness creates correlated restarts across replicas. Boot completion judged by liveness with a short delay creates restart storms on slow nodes. Both errors come from treating the three probes as interchangeable health checks rather than as three different actions.

Use the table during design review. For each row, name the endpoint or command that produces the signal and the threshold that declares it failed. A signal with no owner is a gap; a signal with two owners is a future incident. The table also gives reviewers a shared vocabulary, which shortens manifest debates considerably.

The table doubles as a test plan. Each row can be exercised in staging: stop the dependency and watch readiness remove traffic without restarts, wedge the process and watch liveness act, slow the boot and watch the startup budget hold. Probe behaviour that has never been observed failing on purpose is a hypothesis, not a control. Ten minutes of deliberate failure in staging is cheaper than the first production discovery of a misassigned signal.


9. Kubernetes Probes Troubleshooting Matrix: Event, Cause, Confirming Action

The troubleshooting matrix maps Kubernetes probes events to causes and confirming actions, because probe incidents are diagnosed from events more than from logs. Unhealthy events name the probe type and failure text; Killing events confirm liveness acted. Read events first, then decide whether the application or the configuration is at fault.

Signal Cause it supports Confirming action
Liveness failed during boot window Startup budget missing or undersized Compare boot time with probe timing
Unhealthy events with probe timeout text Endpoint slower than timeoutSeconds Time the endpoint under load
Readiness flapping, endpoints churning Thresholds too tight for latency tail Graph probe latency against period and threshold
All replicas restarting together Dependency check inside liveness Inspect liveness endpoint dependencies
READY 0/1 with zero restarts Readiness failing, container healthy Check readiness endpoint and dependencies
Probe returns 401 or 403 Auth middleware rejecting kubelet Exempt probe paths from authentication
Failures correlate with node pressure CPU throttling starving probe handler Compare failures with throttling metrics
Killing events minutes after deploy New version slower to boot than budget Measure new boot time; resize startup budget

Events are retained for a limited window, so capture describe output early in the incident. The event text includes the HTTP status or exec output that failed, which often names the cause directly: a 503 from a readiness endpoint that checks a database is dependency evidence, not a probe bug.

Correlate probe events with resource metrics before changing timing. Failures that track CPU throttling or memory pressure point at resource sizing, and loosening probes only hides the pressure while the service degrades. Keep throttling and saturation metrics on the same dashboard as probe failure rates so that correlation is visible at a glance during triage.


10. Kubernetes Probes Under Load: Throttling, Timeouts, and False Failures

Kubernetes probes fail falsely under load when the probe handler competes with the workload for the same constrained CPU. A container at its CPU limit gets throttled, the health endpoint answers slowly, timeoutSeconds expires, and the kubelet records a failure against a process that is merely busy. Three such failures restart a healthy container at the worst possible moment.

The mechanism is cgroup CPU bandwidth control. Throttling pauses the container for the remainder of each accounting period once its quota is spent, and a probe arriving during a pause waits. With the default one-second timeout, modest throttling is enough to fail probes. Raising timeoutSeconds to a few seconds absorbs ordinary scheduling delay without materially slowing real deadlock detection, because failureThreshold still governs the overall window.

Probe design can reduce contention. Keep handlers allocation-light and free of locks shared with request handling; a health endpoint that waits on the same mutex as the wedged code path reports failure accurately, but one that waits on a busy-but-healthy path reports noise. Serving probes on a separate port with its own listener, where the framework allows, isolates health evidence from request-path saturation.

Resource requests matter as much as limits. A container with tiny CPU requests on a busy node receives little scheduling priority, and its probes suffer first. Size requests for the probe handler's needs as part of the workload budget, and alert on throttling ratio alongside probe failures so the correlation is visible before restarts begin. The Kubernetes best practices guide covers request sizing in the wider production baseline.

Alert on probe failure patterns, not single failures. One readiness flap during a deploy is noise; rising liveness failures across replicas, or probe timeouts tracking throttling ratio, are signals with different owners. Route liveness restart alerts to the service owner with recent event text attached, and route throttling-correlated timeouts to whoever owns resource sizing. That split prevents the common loop where application teams loosen probes for what is actually a capacity problem, hiding the pressure until it returns as user-visible latency.


11. Kubernetes Probes and Shutdown: Readiness, preStop, and Drain Order

Shutdown behaviour in Kubernetes probes is governed by readiness and termination order rather than by liveness. When a pod is deleted, the kubelet marks it terminating, endpoints removal begins, and the container receives SIGTERM after any preStop hook completes. Readiness failing during drain is expected and correct; the goal is that traffic stops before the process exits.

The race to manage is endpoint propagation. Clients and ingress controllers learn about endpoint removal asynchronously, so a pod that exits immediately on SIGTERM can still receive requests routed from stale endpoint data. A short preStop sleep gives propagation time to catch up, and a readiness endpoint that fails as soon as shutdown begins accelerates removal. terminationGracePeriodSeconds must cover the preStop delay plus real drain time, or the kubelet escalates to SIGKILL mid-request.

yaml
lifecycle:
  preStop:
    exec:
      command: ["/bin/sh", "-c", "sleep 5"]
terminationGracePeriodSeconds: 30

Liveness probes keep running during termination until the container exits, and a liveness failure in that window can kill a draining container early. Applications that close their listener immediately on SIGTERM will fail liveness while draining legitimately. The standard defence is ordering: fail readiness first, keep the health endpoint answering during drain, and exit when in-flight work completes. Frameworks with graceful shutdown support usually handle this, but the probe endpoints must be wired to the shutdown state.

Test shutdown behaviour deliberately. Delete a pod under load and watch endpoint removal, in-flight request completion, and client error rates. Rollouts exercise this path constantly, so a drain bug presents as a small error blip on every deploy, which teams often misattribute to the new version. The pod lifecycle guide details the termination sequence these settings plug into.


12. Kubernetes Probes: Final Checklist and Senior Takeaways

The senior takeaway on Kubernetes probes is that probes are control actions disguised as health checks. Startup decides when judgement begins, readiness decides traffic, and liveness decides restart. Every probe setting should be defensible in those terms: name the action, name the signal that triggers it, and name the budget that separates signal from noise.

Use this checklist for any production workload. Confirm slow starters have a startup probe sized from measured p99 boot time with headroom. Confirm liveness checks only local, restart-repairable state and never dependencies. Confirm readiness carries dependency and warmup evidence, with thresholds that tolerate the latency tail without flapping. Confirm timeoutSeconds is a few seconds rather than the one-second default, and probe endpoints are exempt from authentication and cheap to serve.

Confirm shutdown order: readiness fails at drain start, preStop covers endpoint propagation, and terminationGracePeriodSeconds covers real drain time. Confirm events and restart counts are alerted, with throttling metrics on the same dashboard so false failures are recognisable. Confirm probe settings were tested under load and during a rollout, not only on an idle staging cluster.

During an incident, read events before logs: Unhealthy names the probe and the failure text, Killing confirms liveness acted, and READY 0/1 with zero restarts isolates readiness. Fix the owning probe rather than loosening all three. Teams that assign each signal to one probe and size budgets from measurements stop manufacturing outages with their own monitoring. The kubectl master guide covers the describe and events commands used throughout this diagnosis.

Keep probe settings under the same change discipline as application code. A timing change is a behaviour change with production consequences, and it deserves the same review, staging test, and rollback path. Most probe incidents trace to a copied manifest or an unreviewed threshold tweak rather than to exotic kubelet behaviour. Treating probes as code, with measurements attached to the numbers, is the durable fix. Record the measured boot and latency values beside each budget so future reviewers can tell evidence from habit.

Frequently Asked Questions

What is the difference between Kubernetes probes for startup, readiness, and liveness?

Startup probes judge whether booting has finished and hold the other probes back until it has. Readiness probes judge whether the pod should receive Service traffic and remove it from endpoints on failure without restarting. Liveness probes judge whether the process is wedged beyond self-recovery and restart the container on repeated failure.

Why do Kubernetes probes restart a healthy but slow-starting container?

A liveness probe with a short initial delay judges the container before booting completes, fails repeatedly during cache warming or migrations, and the kubelet kills it mid-boot. The replacement repeats the cycle. A startup probe with a budget sized from measured boot time prevents liveness from judging until startup succeeds.

Should Kubernetes probes check database dependencies in liveness or readiness?

Dependencies belong in readiness, never liveness. A database outage failing liveness restarts every replica into the same outage and creates a restart storm with cold caches. Readiness handles the same event by pausing traffic to affected pods and resuming automatically when the dependency recovers, without any restart.

What timing settings make Kubernetes probes production-safe?

Size the startup budget as failureThreshold times periodSeconds from measured p99 boot time with headroom. Set timeoutSeconds to a few seconds rather than the one-second default so ordinary scheduling delay does not count as failure. Tune readiness thresholds to remove traffic quickly without flapping under the latency tail.

Why do Kubernetes probes fail under CPU throttling?

Throttling pauses the container once its CPU quota is spent, so the health endpoint answers late and timeoutSeconds expires even though the process is healthy. Repeated timeouts restart a busy container at peak load. Raising the timeout, keeping handlers cheap, and alerting on throttling alongside probe failures prevent the false restart.

What does READY 0/1 with zero restarts mean for Kubernetes probes?

It means readiness is failing while the container itself is running normally. The pod is removed from Service endpoints and receives no traffic, but nothing restarts it. Check the readiness endpoint and the dependencies it reports on; the fix is dependency recovery or readiness tuning, not container debugging.

How do Kubernetes probes behave during pod shutdown?

Readiness should fail as soon as draining begins so endpoints removal stops new traffic, a preStop delay covers endpoint propagation, and terminationGracePeriodSeconds covers real drain time. Liveness keeps running during termination, so the health endpoint should keep answering while in-flight work completes to avoid an early kill.

⚡ KUBERNETES SCENARIO INTERVIEW PREP

Preparing for Senior Platform & SRE Interviews

Practice real-world cluster triage, RBAC debugging, and pod scheduling scenarios in our Kubernetes scenario interview questions hub.

Explore Interview Scenarios →