Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

16.3.3.3. 移除 Pod 冲突间的关联性

RemovePodsViolatingInterPodAntiAffinity 策略确保违反了 pod 间的反关联性的 pod 被从节点中驱除。

例如,Node1 具有 podApodBpodCpodBpodC 具有反关联性规则,阻止它们在与 podA 相同的节点上运行。podA 将被从该节点上运行,以便 podBpodC 可以在该节点上运行。当 podBpodC 在节点上运行时,会出现这种情况。

apiVersion: "descheduler/v1alpha1"
kind: "DeschedulerPolicy"
strategies:
  "RemovePodsViolatingInterPodAntiAffinity": 1
     enabled: true
1
将此值设为 enabled: true 以使用此策略。设置为 false 以禁用此策略。