The QoS Class (Quality of Service Class) provides a way for Kubernetes to classify Pods within the cluster into several classes and make decisions about scheduling and eviction.
Stuff you wanna know:
- QoS classes are used to make decisions about Pods scheduling and eviction.
- QoS Class of a Pod is set at creation time based on its compute resources requests and limits settings.
- Kubernetes can assign one of the following QoS classes to a Pod:
Guaranteed
,Burstable
orBestEffort
. - For a Pod to be given a QoS class of Guaranteed:
- Every Container in the Pod must have a memory limit and a memory request.
- For every Container in the Pod, the memory limit must equal the memory request.
- Every Container in the Pod must have a CPU limit and a CPU request.
- For every Container in the Pod, the CPU limit must equal the CPU request.
- A Pod is given a QoS class of Burstable if:
- The Pod does not meet the criteria for QoS class Guaranteed.
- At least one Container in the Pod has a memory or CPU request or limit.
- For a Pod to be given a QoS class of BestEffort, the Containers in the Pod must not have any memory or CPU limits or requests.
- The kubelet uses Priority to determine pod order for node-pressure eviction. You can use the QoS class to estimate the order in which pods are most likely to get evicted.
More stuff:
- Configure Quality of Service for Pods — https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/
- Create a Pod that gets assigned a QoS class of Guaranteed — https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/#create-a-pod-that-gets-assigned-a-qos-class-of-guaranteed
- Create a Pod that gets assigned a QoS class of Burstable — https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/#create-a-pod-that-gets-assigned-a-qos-class-of-burstable
- Create a Pod that gets assigned a QoS class of BestEffort — https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/#create-a-pod-that-gets-assigned-a-qos-class-of-besteffort
- Interactions between Pod priority and quality of service — https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#interactions-of-pod-priority-and-qos
- Kubernetes Resources Management – QoS, Quota, and LimitRange — https://www.cncf.io/blog/2020/06/10/kubernetes-resources-management-qos-quota-and-limitrangeb/
- Configuring a Burstable pod — https://www.oreilly.com/library/view/kubernetes-cookbook-2nd/9781788837606/c6d9e26f-b5a1-4fba-86a1-666a1ae6593d.xhtml
- Getting Started with Kubernetes | Scheduling and Resource Management (Alibaba Cloud) — https://www.alibabacloud.com/blog/getting-started-with-kubernetes-%7C-scheduling-and-resource-management_596298