Docs/CloudNative/Kubernetes/Base/亲和性调度
2022-10-18 16:59:37 +08:00

37 lines
No EOL
1.3 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

pod.spec.affinity.PodAffinitypod亲和性
必须和某些pod调度到一起requiredDuringScheduingIgnoredDuringExecution
优先和某些pod调度到一起PreferredDuringScheduingIgnoredDuringExecution
pod.spec.affinity.PodAntiAffinitypod反亲和性
禁止和某些pod调度到一起requiredDuringScheduingIgnoredDuringExecution
优先不和某些pod调度到一起PreferredDuringScheduingIgnoredDuringExecution
pod.spec.affinity.nodeAffinity,node亲和性必须调度到
禁止调度到requiredDuringScheduingIgnoredDuringExecution
优先不和某些pod调度到一起PreferredDuringScheduingIgnoredDuringExecution
pod.spec.nodeSelector,强制调度到带有某些标签的node中
node加上taints污点
一个node上可以有多个Taints
spec.taints中的effect不能为空有三个不同的级别
NoSchedule 禁止新的pod调度上来
PreferNoSchedule 新pod尽量不调度上来
NoExecute 驱逐evict没有对应toleration的pod也不会调度新的上来
apiVersion: v1
kind: Node
metadata:
name: demo-node
spec:
taints:
- key: 'k1'
value: 'v1'
effect: 'NoSchedul'
pod加上tolerations容忍
一个pod上可以有多个tolerations
effect可以为空匹配所有
取值与taints的effect一致
oprater Exist/Equal