Health check probes timeout because the container cannot respond within the configured timeoutSeconds (default 1 second). This occurs when the application is slow, under resource pressure, or implementing expensive health checks. Fix by increasing timeoutSeconds, allocating more resources, or using startup probes.
Fixes Client.Timeout exceeded while awaiting headers
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 5 # Increased from 1
periodSeconds: 10
failureThreshold: 3livenessProbe:httpGet:path: /healthport: 8080initialDelaySeconds: 30timeoutSeconds: 5 # Increased from 1periodSeconds: 10failureThreshold: 3Client.Timeout exceeded while awaiting headers
Each health probe attempt has a timeout window (default 1 second). If the probe doesn't receive a response within that time, it fails. Repeated timeout failures trigger container restarts (liveness) or mark pod as not-ready (readiness). Timeouts indicate the application is either not responding, taking too long to respond, or the probe endpoint is expensive.
Raise from default 1 second to 5-10 seconds:
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 5 # Increased from 1
periodSeconds: 10
failureThreshold: 3Resource starvation causes slowness:
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1GiMonitor usage:
kubectl top pod <pod-name> -n <namespace>Separate startup from liveness checks:
startupProbe:
httpGet:
path: /health
port: 8080
timeoutSeconds: 5
failureThreshold: 30
livenessProbe:
httpGet:
path: /health
port: 8080
timeoutSeconds: 3
failureThreshold: 3Ensure /health endpoint is lightweight. Avoid:
- Database queries
- External API calls
- Expensive computations
Instead, implement quick checks (memory available, basic connectivity).
Timeout should be sufficient for expected response time + network latency. For HTTP probes, 3-5 seconds is typical. Test locally to determine appropriate timeout. Under sustained load, applications may need higher timeouts. If resource-constrained, allocate more or optimize health check logic.