0
0
Kubernetesdevops~30 mins

Quality of Service classes (Guaranteed, Burstable, BestEffort) in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
Quality of Service classes (Guaranteed, Burstable, BestEffort)
📖 Scenario: You are managing a Kubernetes cluster that runs different applications. Some apps need guaranteed resources, some can burst when needed, and some can use leftover resources. You want to learn how to set Quality of Service (QoS) classes for your pods to control resource allocation.
🎯 Goal: Learn how to create Kubernetes pod YAML files with resource requests and limits to get different QoS classes: Guaranteed, Burstable, and BestEffort.
📋 What You'll Learn
Create a pod YAML with resource requests and limits for CPU and memory
Add resource requests only to create Burstable QoS
Create a pod YAML without any resource requests or limits for BestEffort QoS
Use kubectl to check the QoS class of pods
💡 Why This Matters
🌍 Real World
Setting QoS classes helps Kubernetes decide which pods get resources first and which pods can be evicted when the cluster is busy.
💼 Career
Understanding QoS classes is important for Kubernetes administrators and DevOps engineers to manage resource allocation and ensure application reliability.
Progress0 / 4 steps
1
Create a pod YAML with resource requests and limits for Guaranteed QoS
Create a pod YAML file named guaranteed-pod.yaml with a single container named app. Set both requests and limits for cpu to 500m and memory to 256Mi under resources. Use the image nginx. This will create a pod with Guaranteed QoS class.
Kubernetes
Need a hint?

Remember to set both requests and limits with the same values for CPU and memory to get Guaranteed QoS.

2
Create a pod YAML with resource requests only for Burstable QoS
Create a pod YAML file named burstable-pod.yaml with a single container named app. Set only requests for cpu to 250m and memory to 128Mi under resources. Do not set any limits. Use the image nginx. This will create a pod with Burstable QoS class.
Kubernetes
Need a hint?

Set only requests without limits to get Burstable QoS.

3
Create a pod YAML without resource requests or limits for BestEffort QoS
Create a pod YAML file named besteffort-pod.yaml with a single container named app. Do not set any resources section. Use the image nginx. This will create a pod with BestEffort QoS class.
Kubernetes
Need a hint?

Do not include a resources section to get BestEffort QoS.

4
Check the QoS class of the pods using kubectl
Run the command kubectl get pods guaranteed-pod burstable-pod besteffort-pod -o jsonpath='{range .items[*]}{.metadata.name}: {.status.qosClass}\n{end}' to display the QoS class of each pod.
Kubernetes
Need a hint?

Use the exact kubectl get pods command with -o jsonpath to see the QoS classes.