Pods restart every few minutes with `Liveness probe failed: Get "http://10.0.3.17:8080/healthz": context deadline exceeded (Client.Timeout exceeded while awaiting headers)`.
IntermediateTroubleshootingResources, OOM, probes and termination
Answer
Likely causes → The health endpoint is slower than timeoutSeconds (default 1s) under load or during GC pauses, or it checks dependencies (DB, Redis) so a slow dependency kills every Pod. Liveness kills turn a slowdown into an outage.
Diagnose →
kubectl get deploy api -o jsonpath='{.spec.template.spec.containers[0].livenessProbe}' | jq
kubectl exec api-x -- sh -c 'time wget -qO- localhost:8080/healthz'
kubectl get events --field-selector reason=Unhealthy -n api
Fix → Make liveness a cheap in-process check with no dependency calls, and give it room:
livenessProbe:
httpGet: {path: /livez, port: 8080}
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 6
Prevent → Liveness answers "is the process wedged?", readiness answers "can I take traffic?". Never put dependency checks in liveness.
More on Resources, OOM, probes and termination
`kubectl describe pod` shows `Last State: Terminated, Reason: OOMKilled, Exit Code: 137`.BeginnerA Java service is OOMKilled at 2 GiB limit but the heap is only `-Xmx1800m`.IntermediateMany Pods on one node were killed at once and the node shows a `SystemOOM` event. Container limits were not reached.AdvancedPods show `Evicted` with `The node was low on resource: memory. Threshold quantity: 100Mi, available: 87Mi. Container app was using 1.4Gi, request is 256Mi`.IntermediateA Pod is evicted with `Pod ephemeral local storage usage exceeds the total limit of containers 1Gi`.Intermediatep99 latency spikes every few seconds, CPU usage graph shows only 40% of the limit.Advanced