Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

高级调度 | 袁昊的学习笔记 #42

Open
howieyuen opened this issue Jan 6, 2021 · 0 comments
Open

高级调度 | 袁昊的学习笔记 #42

howieyuen opened this issue Jan 6, 2021 · 0 comments

Comments

@howieyuen
Copy link
Owner

https://howieyuen.github.io/docs/kubernetes/kube-scheduler/advanced-scheduling/

  1. 使用 taint 和 toleration 阻止节点调度到特定节点 # 1.1 taint 和 toleration # taint,是在不修改已有 Pod 的前提下,通过在节点上添加污点信息,拒绝 Pod 的部署。 只有当一个 Pod 容忍某个节点的 taint 时,才能被调度到此节点上。
    显示节点 taint 信息
    kubectl describe node master.k8s ... Name: master.k8s Role: Labels: beta.kubernetes.io/arch=amd64 beta.kubernetes.io/os=linux kubernetes.io/hostname=master.k8s Annotations: node.alpha.kubernetes.io/ttl=0 Taints: node-role.kubernetes.io/master:NoSchedule ... 主节点上包含一个污点,污点包含一个 key 和 value,以及一个 effect,格式为=:。 上面的污点信息表示,key 为 node-role.kubernetes.io/master,value 是空,effect 是 NoSchedule。
    显示 Pod tolerations
    kubectl describe Pod kube-proxy-as92 -n kube-system ... Tolerations: node-role.kubernetes.io/master:=NoSchedule node.alpha.kubernetes.io/notReady=:Exists:NoExecute node.alpha.kubernetes.io/unreachable=:Exists:NoExecute ... 第一个 toleration 匹配了主节点的 taint,表示允许这个 Pod 调度到主节点上。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant