Kubernetes QoS classes¶
Kubernetes QoS classes (Quality of Service) are utilized by the cluster to schedule pods and manage resource contention. Kubernetes assigns a specific QoS class to a Pod at creation time based on the requests and limits defined for its containers^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md]. This classification determines the priority of the Pod when the system is under resource pressure^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md].
Classes¶
Kubernetes primarily defines three QoS classes: Guaranteed, Burstable, and BestEffort^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md].
Guaranteed¶
A Pod is classified as Guaranteed when every container within it meets the condition that request equals limit for both CPU and memory^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md].
This class receives the highest priority. Guaranteed Pods are generally not killed or throttled unless their resource usage exceeds their defined limits and there are no lower-priority Pods available to be evicted^[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
request(for memory or CPU) set^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md].
Burstable Pods offer a minimum resource guarantee but allow the usage of additional computing resources when conditions permit^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md]. They are the first to be killed if system capacity is insufficient and no BestEffort Pods exist^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md].
BestEffort¶
A Pod is classified as BestEffort if none of its containers have request or limit values set^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md].
This class has the lowest priority. In the event of system memory shortage, BestEffort Pods are the first objects to be evicted to free up resources^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md].
Identification¶
The QoS class assigned to a Pod can be observed in the status section of the Pod's configuration, viewable via kubectl get [Pod](<./pod.md>) <name> --output=yaml^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md].
Sources¶
- 400-devops-06-kubernetes-k8s-ithelp-day21-readme.md