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.
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.
No subnets found for EKS cluster
How to fix "eks subnet not found" in Kubernetes
unable to compute replica count
How to fix "unable to compute replica count" in Kubernetes HPA
error: context not found
How to fix "error: context not found" in Kubernetes
default backend - 404
How to fix "default backend - 404" in Kubernetes Ingress
serviceaccount cannot list resource
How to fix "serviceaccount cannot list resource" in Kubernetes