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

 

posted @   fat_girl_spring  阅读(11555)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示