QoS and eviction
QoS is a classification, not a service-level agreement
Kubernetes classifies Pods based on CPU and memory resource declarations after admission. In the conventional container-level model used here, Guaranteed requires every regular and init container to have positive CPU and memory requests and limits, with each request equal to its corresponding limit. BestEffort has no CPU or memory requests or limits on any container. Everything in between is Burstable. This lesson excludes Pod-level resource declarations and special feature gates. QoS does not measure application reliability or give a dedicated physical CPU by itself.
Classify three workloads
Assume no defaulting policies in this example. The table shows single-container Pods after admission. The reporting Pod has both CPU and memory pairs equal, the catalog Pod has unequal pairs, and the optional helper declares neither. For multiple containers, a missing memory limit in just one otherwise Guaranteed Pod changes its class. Disk-only resource settings do not turn a BestEffort Pod into Burstable.
Pod CPU req/limit Memory req/limit QoSreport 500m/500m 256Mi/256Mi Guaranteedcatalog 250m/500m 128Mi/256Mi Burstablehelper absent absent BestEffortRead resource pressure as evidence
Memory pressure is a node condition: the kubelet may need to reclaim memory to protect the node. For memory pressure, eviction ranking considers whether usage exceeds requests, then priority, then relative excess as defined by the signal-specific ranking. QoS is a useful clue, not the ranking algorithm itself. In a toy snapshot, the catalog uses 220Mi against 128Mi and the report uses 200Mi against 256Mi. The catalog is above its request; the report is not. If these are the only candidates and other conditions are equal, catalog is ranked first. Guaranteed Pods may still be evicted if pressure persists; priority and the actual signal matter. Disk and PID pressure use different criteria.
OOM termination is different from eviction
A container exceeding its enforced memory budget may be killed by the kernel. A kubelet may restart the container according to policy, leaving the same Pod identity. Node-pressure eviction terminates the entire Pod; a controller can subsequently create a replacement with a new UID. A CPU cap usually slows CPU-intensive work through throttling on Linux instead of killing a container merely for reaching the cap. A Failed Pod with reason Evicted is not the same as a container lastState termination with reason OOMKilled. An OOMKilled reason alone is not proof of exactly which memory constraint triggered the kill.
Synthetic A: Pod phase=Running; container lastState.terminated.reason=OOMKilled; restartCount=1Synthetic B: Pod phase=Failed; status.reason=EvictedChoose a correction from measurements
Check usage over time, workload concurrency, application memory behavior, node pressure and declared resources. A memory leak is not fixed permanently by repeatedly increasing a limit. A workload with too little CPU may need a realistic request and a reviewed limit; lowering requests to make a chart look efficient can increase contention. In an approved lab, inspect a named Pod and node using explicit context; these commands are not executed.
kubectl --kubeconfig ./lab.kubeconfig --context resource-lab -n resource-study get pod catalog -o yamlkubectl --kubeconfig ./lab.kubeconfig --context resource-lab describe node lab-workerPractice
Open qos-cases.json and pressure-cases.json. Classify each resource declaration, then distinguish a container restart from a failed, evicted Pod. No resource exhaustion is required. State why a high QoS class is not a substitute for application health checks, capacity planning or disruption management.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
QoS and eviction — knowledge check
Apply resource-management concepts to offline scenarios.
All containers have equal positive CPU and memory requests and limits. Which conventional QoS class applies?
One regular container lacks CPU and memory settings; another has equal positive settings. No defaults apply. Which QoS class?
Which condition best distinguishes node-pressure eviction from a container restart?
Under memory pressure, which factor matters for the kubelet ranking?
Can a Guaranteed Pod ever be evicted?