Skip to main content

QoS Class

A QoS (Quality of Service) class is a label Kubernetes automatically assigns to every pod, Guaranteed, Burstable, or BestEffort, based on its resource requests and limits. It determines which pods are evicted first when a node runs short of memory.

The three classes

You never set the class directly. Kubernetes derives it from the resources you configure.

flowchart TD S{"All containers have
requests equal limits
for CPU and memory?"} -->|"Yes"| G["Guaranteed
evicted last"] S -->|"No"| Q{"Any request or
limit set?"} Q -->|"Yes"| B["Burstable
evicted second"] Q -->|"No"| E["BestEffort
evicted first"] classDef decide fill:#475569,color:#ffffff classDef safe fill:#D1FAE5,color:#1E293B classDef mid fill:#FFEDD5,color:#1E293B classDef bad fill:#FEE2E2,color:#1E293B class S,Q decide class G safe class B mid class E bad

Resource config to class

Configuration Class
No requests or limits anywhere BestEffort
Some set, not all equal Burstable
Requests equal limits on every container Guaranteed

Check classes

Bash
kubectl get pod payment-api-7d9f8c-xkp2q -n production -o jsonpath='{.status.qosClass}'
kubectl get pods -n production -o custom-columns=NAME:.metadata.name,QOS:.status.qosClass

How eviction uses QoS

When a node crosses its memory eviction threshold, the kubelet evicts BestEffort pods first, then Burstable pods exceeding their requests (largest overage first), and Guaranteed pods only as a last resort. QoS also influences the kernel OOM score, so lower classes are more likely to be killed during an OOM.

Bash
kubectl describe node mumbai-prod-node-2 | grep -A 5 Conditions
kubectl get events -n production | grep -i evict
Remember

The class is read-only and derived. Only your resources configuration changes it.

Tip

Audit production namespaces regularly with the custom-columns command and fix any BestEffort pods.

Common Mistake

Assuming an injected sidecar keeps your pod Guaranteed. If it has different requests and limits, the pod silently becomes Burstable.

Frequently Asked Questions

How does Kubernetes decide the QoS class?

From requests and limits. Guaranteed needs requests equal to limits for CPU and memory on every container. Burstable covers partial configuration. BestEffort means nothing is set.

Why do pods without requests get evicted first?

The kubelet treats them as the lowest priority under pressure. Skipping requests can leave business-critical workloads exposed to eviction.

Is QoS the same as PriorityClass?

No. QoS reflects resource configuration and drives node-pressure eviction. PriorityClass influences scheduling order and preemption when the cluster is full.

Found a mistake, an outdated step or a broken link?