Liveness probe timeout
KubernetesWARNINGNotableContainer ErrorHIGH confidence

Liveness probe did not respond within timeoutSeconds

Production Risk

Unnecessary container restarts during peak traffic cause brief service interruptions.

What this means

A liveness probe timeout occurs when the probe (HTTP, TCP, or exec) does not complete within the configured timeoutSeconds. Kubernetes counts this as a probe failure. If timeouts occur consecutively beyond failureThreshold, the container is killed. Timeouts often indicate a temporarily overloaded application rather than a true deadlock.

Why it happens
  1. 1Application is under heavy load and the health endpoint response is slow
  2. 2timeoutSeconds configured too low (default is 1 second, often too tight)
  3. 3Health endpoint performs expensive operations (DB queries) that slow under load
  4. 4Network or DNS delay on the node causing HTTP probe latency
How to reproduce

Container restarts with events showing probe timeout; often correlated with high CPU or load spikes.

trigger — this will error
trigger — this will error
kubectl describe pod mypod | grep -A 5 "Events:"
# Warning  Unhealthy  kubelet  Liveness probe failed: (Timeout exceeded while awaiting headers)

kubectl describe pod mypod | grep -A 10 "Liveness:"

expected output

Warning  Unhealthy  ...  Liveness probe failed: (Timeout exceeded while awaiting headers)

Fix 1

Increase timeoutSeconds and failureThreshold

WHEN Application is healthy but slow under load

Increase timeoutSeconds and failureThreshold
livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
  timeoutSeconds: 10     # Increase from default 1s
  failureThreshold: 5
  periodSeconds: 20

Why this works

Larger timeout gives the application more time to respond before the probe is counted as failed.

Fix 2

Make the health endpoint lightweight

WHEN Health endpoint is too expensive

Make the health endpoint lightweight
# Health endpoint should return immediately without querying databases
# Example: just return 200 OK if the server is running
# Move deep health checks to a separate /ready endpoint

Why this works

A fast-returning health endpoint prevents timeouts during load spikes.

Sources
Official documentation ↗

Kubernetes Documentation

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Kubernetes errors