一、nodeAffinity
類似于nodeSelector,根據節點上的标簽來排程Pod到哪些節點
二、排程政策
硬政策(required):必須滿足,不滿足則Pod處于Pending狀态
軟政策(preferred):嘗試滿足,但不保證
操作符:In、NotIn、Exists、DoseNotExist、Gt、Lt
三、示例
3.1.硬政策
3.1.硬政策
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: nodeType
operator: In
values:
- dev
3.2.軟政策
3.2.軟政策
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: nodeType
operator: In
values:
- test