Kubernetes QoS Guaranteed class¶
Kubernetes QoS Guaranteed class is a Quality of Service (QoS) class assigned to Pods to ensure they receive a fixed amount of resources. This class represents the highest priority for resource scheduling and stability in Kubernetes^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
Definition¶
A Pod is classified as Guaranteed when specific conditions are met regarding its CPU and memory resource requests and limits^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
For a Pod to be categorized in this class, every container within it must satisfy the following equality^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md]:
request.memory==limit.memoryrequest.cpu==limit.cpu
This means that the container is guaranteed a specific amount of resources and cannot consume more than that amount.
Configuration Example¶
The following manifest demonstrates a Pod configuration that results in a Guaranteed QoS class^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
apiVersion: v1
kind: Pod
metadata:
name: qos-demo
namespace: qos-example
spec:
containers:
- name: qos-demo-ctr
image: nginx
resources:
limits:
memory: "200Mi"
cpu: "700m"
requests:
memory: "200Mi"
cpu: "700m"
Characteristics and Behavior¶
Priority and Eviction¶
Pods in the Guaranteed class are assigned the highest priority level compared to other QoS classes^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
- Stability: They are typically protected from being killed or throttled as long as their resource usage remains within the defined limits^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
- Eviction Order: When system memory is insufficient, Kubernetes relies on QoS classes to determine eviction order.
Best-EffortPods (lowest priority) are evicted first.GuaranteedPods are the last to be evicted, generally only killed if they exceed their resource limits and no lower-priority Pods are available to terminate^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
Resource Comparison¶
The Guaranteed class contrasts with other QoS tiers in how resources are handled:
- vs. Burstable: Burstable Pods have a minimum resource guarantee but are allowed to exceed their requests up to their limits. Guaranteed Pods operate strictly at a fixed capacity^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
- vs. BestEffort: BestEffort Pods have no resource requests or limits and can use available resources sparingly, but they are the first to be terminated under resource pressure^[400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md].
Related Concepts¶
- Kubernetes QoS Burstable class
- Kubernetes QoS BestEffort class
- [[Kubernetes Resources]]
Sources¶
400-devops__06-Kubernetes__k8s-ithelp__Day21__README.md