What's the difference between Priority Class and QoS in Kubernetes?

六月ゝ 毕业季﹏ 提交于 2021-01-29 05:09:32

问题


In Kubernetes we can set the priority of a pod to Guaranteed, Burstable or Best-Effort base on requests and limits. Another method to assign priorities in Kubernetes is to define a priorityClass object and assign a priorityClassName to a pod. How are these methods different and when we have to choose one method over another? According to https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#interactions-of-pod-priority-and-qos:

The scheduler’s preemption logic does not consider QoS when choosing preemption targets. Preemption considers Pod priority and attempts to choose a set of targets with the lowest priority.

So if the Kubernetes has to choose between a pod with Guaranteed QoS which has a lower "priorityClass" Value than a Burstable pod, does it put the Guaranteed pod in Preempting state?


回答1:


Quality of Service determines scheduling and eviction priority of pods. When a pod is not given any resources requests/ limits it is considered as low-priority pod (best effort). If node is out of resources it is the first pod to be evicted.

Medium priority (burstable) when a pod has any resource/limits specified (does not meet guaranteed class requirements).

Highest priority (guaranteed) when a pod has requests and limits set to the same value (both CPU and memory).

PriorityClass is used to determine pod priority when it comes to eviction. Sometimes you may want one pod to be evicted before another pod. Priority is described by integer in it's value field and the higher the value, the higher the priority.

When Pod priority is enabled, the scheduler orders pending Pods by their priority and a pending Pod is placed ahead of other pending Pods with lower priority in the scheduling queue. If there are no nodes with resources to satisfy high-priority node it will evict pods with lower priority. The highest priority is system-node-critical.

  • QoS is used to control and manage resources on the node among the pods. QoS eviction happens when there are no available resources on the node.
  • The scheduler considers the PriorityClass of the Pod before the QoS. It does not attempt to evict Pods unless higher-priority Pods need to be scheduled and the node does not have enough room for them.
  • PriorityClass- when pods are preempted, PriorityClass respects graceful termination period but does not guarantee pod disruption budget to be honored.



回答2:


The scheduler would simply ignore the QoS as mentioned. Preemption only takes into consideration the priorityClass, QoS has not effect here.



来源:https://stackoverflow.com/questions/61711635/whats-the-difference-between-priority-class-and-qos-in-kubernetes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!