Kubernetes中的优先级和QoS有什么区别? [英] What's the difference between Priority Class and QoS in Kubernetes?

查看:190
本文介绍了Kubernetes中的优先级和QoS有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Kubernetes中,我们可以根据请求和限制将Pod的优先级设置为GuaranteedBurstableBest-Effort.在Kubernetes中分配优先级的另一种方法是定义priorityClass对象并将priorityClassName分配给Pod.这些方法有何不同?何时我们必须选择一种方法而不是另一种方法?根据 https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#interactions-pod-priority-and-qos :

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:

在选择抢占目标时,调度程序的抢占逻辑不考虑QoS.抢占考虑Pod优先级,并尝试选择优先级最低的一组目标.

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.

因此,如果Kubernetes必须在具有Guaranteed QoS且"priorityClass"值低于Burstable荚的QoS荚之间进行选择,是否会将Guaranteed荚置于抢占"状态?

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?

推荐答案

Quality of Service确定Pod的调度和逐出优先级.如果未向Pod提供任何资源请求/限制,则将其视为low-priority pod (best effort).如果节点资源不足,它将是第一个驱逐的Pod.

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),如果Pod已指定任何资源/限制(不满足保证的类要求).

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

Highest priority (guaranteed),如果Pod的请求和限制设置为相同的值(CPU和内存).

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

PriorityClass用于确定驱逐时的Pod优先级.有时您可能希望先驱逐一个吊舱,然后再驱逐另一个吊舱.优先级在其value字段中用整数描述,值越高,优先级越高.

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.

启用Pod优先级时,调度程序按优先级对未决Pod进行排序,并且将未决Pod放在调度队列中其他优先级较低的未决Pod的前面.如果没有资源满足高优先级节点的节点,它将驱逐优先级较低的Pod.最高优先级是system-node-critical.

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用于控制和管理节点之间的资源. 豆荚.当没有可用资源时,将逐出QoS 节点.
  • 调度程序在QoS之前考虑Pod的PriorityClass.除非需要安排更高优先级的Pod并且节点没有足够的空间容纳它们,否则它不会尝试驱逐Pod.
  • PriorityClass-抢占吊舱时,PriorityClass遵守宽限期终止期限,但不能保证兑现吊舱中断预算.
  • 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.

这篇关于Kubernetes中的优先级和QoS有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆