Kubernetes QoS Classes: Guaranteed, Burstable, and BestEffort Pod Eviction Priorities
QoS classes (Guaranteed, Burstable, BestEffort) determine which pods are evicted first when a node runs out of memory — Guaranteed pods are evicted last, Bes...
Quick Answer: QoS classes (Guaranteed, Burstable, BestEffort) determine which pods are evicted first when a node runs out of memory — Guaranteed pods are evicted last, BestEffort pods first.
Detailed Answer:
QoS Class Assignment (automatic — you don't set it directly):
Guaranteed ← BEST: Last to be evicted
Condition: requests == limits for ALL containers (both CPU and memory)
resources:
requests: {cpu: "500m", memory: "512Mi"}
limits: {cpu: "500m", memory: "512Mi"} ← exactly equal
Burstable ← MIDDLE: Evicted after BestEffort
Condition: At least one container has requests < limits
OR: requests set but no limits (common pattern)
resources:
requests: {cpu: "250m", memory: "256Mi"}
limits: {memory: "512Mi"} ← different from requests
BestEffort ← WORST: Evicted FIRST
Condition: No requests OR limits set on ANY container
resources: {} ← completely empty
# Check QoS class of a pod
kubectl get pod my-pod \
-o jsonpath='{.status.qosClass}'
# Returns: Guaranteed | Burstable | BestEffort
# Check all pods and their QoS
kubectl get pods -A \
-o custom-columns='NAMESPACE:.metadata.namespace,NAME:.metadata.name,QOS:.status.qosClass'
Eviction Order Under Memory Pressure:
Node running low on memory:
│
▼
kubelet evicts BestEffort pods first (highest consumption over request)
│
▼
If still low: evicts Burstable pods (furthest over their request)
│
▼
If still critical: evicts Guaranteed pods (last resort)
│
▼
If node still unstable: kernel OOM killer starts killing processes
Production Recommendations:
| Workload Type | Recommended QoS | Reasoning | |---|---|---| | Critical databases | Guaranteed | Must not be evicted unexpectedly | | Production APIs | Burstable | Balance between protection and flexibility | | Batch jobs | BestEffort or Burstable | Can be interrupted and restarted | | Dev/test workloads | BestEffort | Acceptable to evict for prod workloads |
# Guaranteed QoS — for critical stateful workloads
resources:
requests:
cpu: "1000m"
memory: "2Gi"
limits:
cpu: "1000m" # Must equal requests for Guaranteed
memory: "2Gi" # Must equal requests for Guaranteed
# Burstable QoS — for most production stateless apps
resources:
requests:
cpu: "250m"
memory: "256Mi"
limits:
memory: "512Mi" # Higher than request = Burstable
# No CPU limit = also Burstable (requests set but not limits)
Key Takeaway: BestEffort pods are the first casualties when nodes run low on memory — always set at least memory requests on production workloads to achieve Burstable QoS minimum.
Finished reading?
Mark as complete to claim your +15 XP and track progress.
