Kubernetes QoS Explained: How Pods Are Prioritized for Eviction 🚀

Shaik MustafaShaik Mustafa
3 min read

Imagine you have a Kubernetes Node (NODE-1) running multiple applications (Pods). Suddenly, the memory usage spikes—meaning the Node is running out of memory.

What happens now?

Kubernetes must free up some space to keep the Node healthy. The only way? Evict (remove) some Pods to make room.

But which Pod should be removed first?

This is where QoS (Quality of Service) classes come into play!

Every Pod in Kubernetes falls into one of three QoS classes based on how it requests CPU and memory:
1️⃣ Guaranteed – Strongest priority (least likely to be evicted).
2️⃣ Burstable – Medium priority (evicted if needed).
3️⃣ BestEffort – Weakest priority (evicted first when the Node is under pressure).

Back to our scenario:

  • NODE-1 is running out of memory 🚨

  • Kubernetes checks the QoS of all running Pods

  • Pod3 has BestEffort QoS (meaning it didn’t request a fixed amount of resources)

  • Since BestEffort Pods are the first to be evicted, Pod3 gets removed

The good news?

Kubernetes reschedules Pod3 to NODE-2, where there is enough space. 🎉

Key Takeaway:
If you want your Pods to be less likely to get evicted, ensure they request CPU/memory properly so they at least fall into Burstable or, even better, Guaranteed QoS class.


How QoS is Determined:

Kubernetes assigns a Pod one of these three QoS classes based on resource requests and limits in the container spec.

1️⃣ Guaranteed QoS (Highest Priority)

All containers in the Pod must specify both requests and limits, and they must be equal.

Example:

apiVersion: v1
kind: Pod
metadata:
  name: pod-guaranteed
spec:
  containers:
  - name: app
    image: nginx
    resources:
      requests:
        memory: "500Mi"
        cpu: "200m"
      limits:
        memory: "500Mi"
        cpu: "200m"

👉 Since requests == limits, this Pod gets Guaranteed QoS.


2️⃣ Burstable QoS (Medium Priority)

✅ If at least one container specifies requests or limits, but they are not equal, the Pod is Burstable.

Example:

apiVersion: v1
kind: Pod
metadata:
  name: pod-burstable
spec:
  containers:
  - name: app
    image: nginx
    resources:
      requests:
        memory: "250Mi"
      limits:
        memory: "500Mi"

👉 This Pod is Burstable because requests ≠ limits. It can use extra memory if available, but will be evicted before a Guaranteed Pod.


3️⃣ BestEffort QoS (Lowest Priority, First to be Evicted)

✅ If no requests or limits are set for any container in the Pod, it falls into the BestEffort category.

Example:

apiVersion: v1
kind: Pod
metadata:
  name: pod-besteffort
spec:
  containers:
  - name: app
    image: nginx

👉 This Pod has BestEffort QoS because no CPU/memory requests or limits are specified. It will be evicted first if the Node runs out of resources.


Conclusion

Understanding Kubernetes QoS (Quality of Service) classes is crucial for managing resource allocation and ensuring application stability. When a Node experiences high memory or CPU pressure, Kubernetes prioritizes Pod eviction based on their QoS class:

  • BestEffort Pods are evicted first since they have no resource guarantees.

  • Burstable Pods are next in line, as they have some resource requests but may exceed limits.

  • Guaranteed Pods are the most resilient, as they explicitly define and reserve CPU and memory.

By correctly setting requests and limits in your Pod manifests, you can prevent unexpected evictions and ensure critical workloads remain stable. Understanding QoS helps you design efficient, reliable, and resilient Kubernetes clusters.

🔹 Pro Tip: Always define appropriate resource requests and limits for your Pods to avoid unwanted evictions and optimize cluster performance! 🚀

Give me your heart 💖

If you found this blog helpful for your interviews or in learning Docker troubleshooting, please hit a heart for 10 times and drop a comment! Your support motivates me to create more content on DevOps and related topics. ❤️

If you'd like to connect or discuss more on this topic, feel free to reach out on LinkedIn.
Linkedin: linkedin.com/in/musta-shaik

1
Subscribe to my newsletter

Read articles from Shaik Mustafa directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shaik Mustafa
Shaik Mustafa