Solution:
Root Cause: Worker Node Resource Exhaustion and Kubelet Eviction Thresholds When a worker node memory utilization breaches the
memory.available eviction threshold set on the
kubelet, the control plane marks the node under
MemoryPressure. Kubelet begins evicting BestEffort and Burstable pods, forcing continuous container restarts.
Step-by-Step Fix: 1 Inspect Worker Node Conditions:
Check node status: kubectl get nodes and kubectl describe node <node-name>. Look under Conditions for MemoryPressure: True or DiskPressure: True. 2 Identify Resource-Heavy Pods:
Run kubectl top nodes and kubectl top pods --all-namespaces --sort-by=memory. 3 Apply Guaranteed Quality of Service (QoS) Class:
Ensure critical pods have identical requests and limits for both CPU and memory to assign Guaranteed QoS class, protecting them from eviction during node pressure: Copy
yaml
resources:
requests:
memory: "1Gi"
cpu: "1000m"
limits:
memory: "1Gi"
cpu: "1000m"
4 Drain and Rescale Node Capacity:
Cordon and drain the overloaded node: kubectl cordon <node-name> then kubectl drain <node-name> --ignore-daemonsets. Scale your cluster autoscaler or add additional worker nodes to redistribute workloads.