kubernetes 设置 Master 可调度与不可调度

kubernetes 设置 Master 可调度与不可调度

语法

kubectl taint node [node] key=value[effect]

[effect] 可取值: [ NoSchedule | PreferNoSchedule | NoExecute ]

NoSchedule: 一定不能被调度

PreferNoSchedule: 尽量不要调度

NoExecute: 不仅不会调度, 还会驱逐Node上已有的Pod

取消污点

取消污点
[root@k8s-master01 ~]# kubectl taint node k8s-master node-role.kubernetes.io/master-

设置污点

# 设置为一定不能被调度

[root@k8s-master01 ~]# kubectl taint node k8s-master01 node-role.kubernetes.io/master="":NoSchedule
node/k8s-master01 tainted
[root@k8s-master01 ~]# kubectl taint node k8s-master02 node-role.kubernetes.io/master="":NoSchedule
node/k8s-master02 tainted
[root@k8s-master01 ~]# kubectl taint node k8s-master03 node-role.kubernetes.io/master="":NoSchedule
node/k8s-master03 tainted
[root@k8s-master01 ~]# 

# 查看污点
[root@k8s-master01 ~]# kubectl  describe  node | grep Ta
Taints:             node-role.kubernetes.io/master:NoSchedule
Taints:             node-role.kubernetes.io/master:NoSchedule
Taints:             node-role.kubernetes.io/master:NoSchedule
Taints:             <none>
Taints:             <none>
Taints:             <none>
Taints:             <none>
Taints:             <none>
[root@k8s-master01 ~]# 

查看验证

设置污点

查看验证

https://www.oiox.cn/ https://www.chenby.cn/ https://cby-chen.github.io/ https://blog.csdn.net/qq_33921750 https://my.oschina.net/u/3981543 https://www.zhihu.com/people/chen-bu-yun-2 https://segmentfault.com/u/hppyvyv6/articles https://juejin.cn/user/3315782802482007 https://cloud.tencent.com/developer/column/93230 https://www.jianshu.com/u/0f894314ae2c https://www.toutiao.com/c/user/token/MS4wLjABAAAAeqOrhjsoRZSj7iBJbjLJyMwYT5D0mLOgCoo4pEmpr4A/

CSDN、GitHub、知乎、开源中国、思否、掘金、简书、腾讯云、今日头条、个人博客、全网可搜《小陈运维》

文章主要发布于微信:《Linux运维交流社区》

最后更新于