kubernets的報錯:0/2 nodes are available: 1 node(s) had taint {env_role: }, that the pod didn't tolerate, 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate


報錯內容:

[root@test ~]# kubectl describe pod web-96d5df5c8-k265c
Name:           web-96d5df5c8-k265c
Namespace:      default
Priority:       0
Node:           <none>
Labels:         app=web
                pod-template-hash=96d5df5c8
Annotations:    <none>
Status:         Pending
IP:             
IPs:            <none>
Controlled By:  ReplicaSet/web-96d5df5c8
Containers:
  nginx:
    Image:        nginx
    Port:         <none>
    Host Port:    <none>
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-pl58b (ro)
Conditions:
  Type           Status
  PodScheduled   False 
Volumes:
  default-token-pl58b:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-pl58b
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason            Age   From               Message
  ----     ------            ----  ----               -------
  Warning  FailedScheduling  39m   default-scheduler  0/2 nodes are available: 1 node(s) had taint {env_role: }, 
that the pod didn't tolerate, 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate.

檢查一下看看node是否被打污點了

[root@test ~]# kubectl describe node node01 |grep Taint
Taints:             env_role:NoSchedule

污點值有三個

  • NoSchedule:一定不被調度
  • PreferNoSchedule:盡量不被調度【也有被調度的幾率】
  • NoExecute:不會調度,並且還會驅逐Node已有Pod

果不其然,node節點變成了NoSchedule

去掉污點

[root@test ~]# kubectl taint node node01 env_role:NoSchedule-
node/node01 untainted
[root@test ~]# kubectl describe node node01 |grep Taint
Taints:             env_role:PreferNoSchedule

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM