node容忍

报错信息

[root@master1 test]# kubectl top nodes
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)

查看

[root@master1 test]# kubectl get no -o yaml | grep taint -A 5 
    taints:
    - effect: NoSchedule
      key: node-role.kubernetes.io/master
  status:
    addresses:
    - address: 192.168.0.39
--
    taints:
    - effect: NoSchedule
      key: node-role.kubernetes.io/master
  status:
    addresses:
    - address: 192.168.0.46
--
    taints:
    - effect: NoSchedule
      key: node-role.kubernetes.io/master
  status:
    addresses:
    - address: 192.168.0.34
--
    taints:
    - effect: NoSchedule
      key: node.kubernetes.io/unreachable
      timeAdded: "2020-05-14T02:56:43Z"
    - effect: NoExecute
      key: node.kubernetes.io/unreachable
--
    taints:
    - effect: NoSchedule
      key: node.kubernetes.io/unreachable
      timeAdded: "2020-05-14T02:56:48Z"
    - effect: NoExecute
      key: node.kubernetes.io/unreachable

允许master创建nodes

[root@master1 test]# kubectl taint nodes --all node-role.kubernetes.io/master-
node/master1 untainted
node/master2 untainted
node/master3 untainted
taint "node-role.kubernetes.io/master" not found
taint "node-role.kubernetes.io/master" not found
[root@master1 test]# kubectl taint nodes --all node-role.kubernetes.io/master-
node/master1 untainted
node/master2 untainted
node/master3 untainted

删除 taint 规则

kubectl taint node –all node.kubernetes.io:NoSchedule-