Kubernetes QoS (Quality of Service) Classes¶
Kubernetes Quality of Service (QoS) refers to the classification system used to schedule and manage Pods based on their compute resource (CPU and Memory) requests and limits. When creating a Pod, Kubernetes assigns it one of three QoS classes—Guaranteed, Burstable, or BestEffort—which determines the Pod's priority for resource allocation and its likelihood of being evicted during resource starvation^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
QoS Classes¶
Guaranteed¶
A Pod is classified as Guaranteed if every container within it meets the following conditions^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md]:
- The request.memory equals the limit.memory.
- The request.cpu equals the limit.cpu.
Example:
resources:
limits:
memory: "200Mi"
cpu: "700m"
requests:
memory: "200Mi"
cpu: "700m"
This class represents the highest priority. Guaranteed Pods are typically not killed or throttled unless they exceed their resource limits and no lower-priority Pods can be evicted to free up space^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
Burstable¶
A Pod is classified as Burstable if it meets two conditions^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md]:
- It is not a Guaranteed Pod.
- At least one container in the Pod has a memory or cpu request set.
Example:
resources:
limits:
memory: "200Mi"
requests:
memory: "100Mi"
These Pods have a minimum resource guarantee but are allowed to use more resources (up to their limits) when capacity is available^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md]. If no BestEffort Pods exist and the system runs out of resources, Burstable Pods are the first to be evicted^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
BestEffort¶
A Pod is classified as BestEffort if none of its containers have any request or limit values set for CPU or Memory^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
Example:
resources: {}
This class has the lowest priority. BestEffort Pods are the first candidates for eviction when system memory or other resources are insufficient^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
Related Concepts¶
- Kubernetes Resource Requests and Limits
- [[Pod Eviction]]
- Kubernetes Scheduler
Sources¶
^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md]