This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.3.10.6. 根据优先级过滤 pod
只有在优先级低于指定优先级级别时,可以配置 descheduler 策略来考虑 pod 进行驱除。高于指定优先级阈值的 Pod 不视为驱除。
您可以使用 ThresholdPriority
参数设置数字优先级阈值,或者您可以使用 ThresholdPriorityClassName
参数指定特定的优先级类名称。
先决条件
- 必须具有集群管理员权限。
流程
编辑
KubeDescheduler
对象:$ oc edit kubedeschedulers.operator.openshift.io cluster -n openshift-kube-descheduler-operator
在一个或多个策略中添加
ThresholdPriority
或ThresholdPriorityClassName
参数:apiVersion: operator.openshift.io/v1beta1 kind: KubeDescheduler metadata: ... spec: deschedulingIntervalSeconds: 3600 strategies: - name: "RemovePodsHavingTooManyRestarts" params: - name: "PodRestartThreshold" value: "10" - name: "IncludingInitContainers" value: "false" - name: "ThresholdPriority" 1 value: "10000" - name: "PodLifeTime" params: - name: "MaxPodLifeTimeSeconds" value: "86400" - name: "ThresholdPriorityClassName" 2 value: "my-priority-class-name" 3
- 保存文件以使改变生效。