Interview Prep/Kubernetes/Resources, OOM, probes and termination

Pods show `Evicted` with `The node was low on resource: memory. Threshold quantity: 100Mi, available: 87Mi. Container app was using 1.4Gi, request is 256Mi`.

IntermediateTroubleshootingResources, OOM, probes and termination
Answer

Likely causes → Node-pressure eviction. The kubelet evicts Pods whose usage exceeds their request the most, so a Burstable Pod using 1.4 GiB against a 256 MiB request is first in line.

Diagnose →

kubectl get pods -A --field-selector status.phase=Failed | grep Evicted
kubectl get pod api-x -o jsonpath='{.status.message}'
kubectl describe node ip-10-0-1-9 | grep -i pressure

Fix → Raise the request to real usage so the scheduler places it correctly. Clean up evicted Pod objects: kubectl delete pods -A --field-selector status.phase=Failed.

Prevent → Requests close to real usage, Guaranteed QoS for critical services, and alerts on MemoryPressure.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, OOM, probes and termination