当前位置:   article > 正文

node(s) didn‘t match node selector._3 node(s) didn't match node selector, 3 pod has un

3 node(s) didn't match node selector, 3 pod has unbound immediate persistent
  • k8s集群中,有pod出现了 Pending ,通过 kubectl describe pod 命令,发现了如下报错
0/4 nodes are available: 1 node(s) had taint {node.kubernetes.io/disk-pressure: }, that the pod didn't tolerate, 3 node(s) didn't match node selector.
  • 1
  • 这是因为节点被打上了污点(pod的yaml文件中配置了 node selector ,和 nodelabel 做了绑定,因此,导致了pod没有节点可以起来)
Linux:~ #  kubectl get nodes -o json | jq '.items[].spec'
{}
{}
{
 "taints": [
   {
     "effect": "NoSchedule",
     "key": "node.kubernetes.io/disk-pressure",
     "timeAdded": "2021-03-06T14:15:27Z"
   }
 ]
}
{}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 可以看到,节点被打上了污点,并且是 NoSchedule ,不可调度
  • 进行如下操作,取消所有节点的 node.kubernetes.io/disk-pressure 这个名称的污点
Linux:~ # kubectl taint nodes --all node.kubernetes.io/disk-pressure-
node/k8s-w1 untainted
taint "node.kubernetes.io/disk-pressure" not found
taint "node.kubernetes.io/disk-pressure" not found
taint "node.kubernetes.io/disk-pressure" not found
  • 1
  • 2
  • 3
  • 4
  • 5
  • 如果节点还是Pending,可以导出 pod 的 yaml 文件,重新 kubectl apply -f xxx.yaml 即可(如果 pod 有 deployment ,则直接 kubectl delete pod 即可)
  • 如果还是 Pending , 则再次执行 kubectl describe pod 查看报错的原因
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/828045
推荐阅读
相关标签
  

闽ICP备14008679号