Taint and toleration

来源:5-1 创建Nginx Pod

爱滑板的小菜鸡

2021-09-07

在刚create nginx yaml的pod时候,遇到了这个error
3 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn’t tolerate.
这个是因为在三个node(master, node1, node2) 里面,没有把toleration 容错率的config remove掉。
可以通过下面这个command to remove

  1. 首先 kubectl describe node node1 | grep Taints 查看node1 节点的taints config
    如果返回 Taints: node-role.kubernetes.io/master:NoSchedule
    说明当前的node taints key是node-role.kubernetes.io/master。 default value is NoSchedule
  2. 可以运行 “kubectl taint nodes node1 key1=value1:NoSchedule-” 把这个config remove掉
  3. 之后相当于当前那个node1 就是available,可以schedule到那个node上面。
  4. 相应的“kubectl taint nodes node1 key1=value1:NoSchedule“ 命令行可以用于加载上这个taints config
写回答

Kubernetes 入门到进阶实战,系统性掌握 K8s 生产实践

阿里云最有价值专家亲授,云原生时代必备技能

1517 学习 · 616 问题

查看课程