This story was written with the assistance of an AI writing program.
A node runs low on memory. Kubernetes has to evict pods. Which ones go first?
Your requests and limits shape the answer, through the pod's QoS class.
Kubernetes assigns every pod one of three:
BestEffort - no CPU or memory requests or limits set.
Burstable - at least one request or limit set, but not fully Guaranteed.
Guaranteed - every container has CPU and memory requests AND limits, each request equal to its limit.
Under memory pressure, the kubelet evicts in this order: first, pods using more than they requested - sorted by priority, then by how far above the request they are. Last, pods still within their requests, which is where Guaranteed pods land.
Two things people get wrong here:
QoS does not set a pod's priority. Priority comes from priorityClassName, a separate setting. The QoS class is a useful estimate of eviction order, not the mechanism.
This ranking is about memory pressure. Other eviction signals follow different rules.
Check any pod's class:
kubectl get pod <name> -o jsonpath='{.status.qosClass}'
Takeaway: under memory pressure, pods using more than they requested go first. Requests and limits won't change your pod's priority, but they decide which side of that line you are on.
Top comments (0)