node(s) didn‘t match node selector.

简介: node(s) didn‘t match node selector.
  • 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.
  • 这是因为节点被打上了污点(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"
   }
 ]
}
{}
  • 可以看到,节点被打上了污点,并且是 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

如果节点还是Pending,可以导出 pod 的 yaml 文件,重新 kubectl apply -f xxx.yaml 即可(如果 pod 有 deployment ,则直接 kubectl delete pod 即可)

如果还是 Pending , 则再次执行 kubectl describe pod 查看报错的原因

相关实践学习
容器服务Serverless版ACK Serverless 快速入门:在线魔方应用部署和监控
通过本实验,您将了解到容器服务Serverless版ACK Serverless 的基本产品能力,即可以实现快速部署一个在线魔方应用,并借助阿里云容器服务成熟的产品生态,实现在线应用的企业级监控,提升应用稳定性。
云原生实践公开课
课程大纲 开篇:如何学习并实践云原生技术 基础篇: 5 步上手 Kubernetes 进阶篇:生产环境下的 K8s 实践 相关的阿里云产品:容器服务 ACK 容器服务 Kubernetes 版(简称 ACK)提供高性能可伸缩的容器应用管理能力,支持企业级容器化应用的全生命周期管理。整合阿里云虚拟化、存储、网络和安全能力,打造云端最佳容器化应用运行环境。 了解产品详情: https://www.aliyun.com/product/kubernetes
目录
相关文章
|
网络协议 MySQL 关系型数据库
|
22天前
|
资源调度 JavaScript 内存技术
error @achrinza/node-ipc@9.2.2: The engine “node“ is incompatible with this module. Expected version
error @achrinza/node-ipc@9.2.2: The engine “node“ is incompatible with this module. Expected version
161 0
|
22天前
|
JavaScript 前端开发 数据库
【Node系列】node中的函数
在Node.js中,函数是一段可重复使用的代码,它可以接受输入(参数),执行一系列操作,并返回一个结果(返回值)。
19 3
|
12月前
|
Web App开发 运维 JavaScript
Node的介绍
Node的介绍
131 0
|
JSON 负载均衡 JavaScript
Node【一】初识Node
Node【一】初识Node
117 0
Node【一】初识Node
|
运维 监控 JavaScript
gmailWatcher之node
gmailWatcher之node
68 0
|
Web App开发 JavaScript 前端开发
node初探 什么是node
前言里面说了,node 是一门使用chorme V8 引擎来解析JavaScript, 并且解决异步IO,事件驱动,高性能的一种脚本语言,它的出来就搭上了chrome浏览器开发的v8引擎的这一趟快车。
node初探 什么是node
|
JavaScript 前端开发 内存技术
Node(一)初识
Node(一)初识
86 0
|
自然语言处理 算法 分布式数据库
Node 与 Cluster
Node 与 Cluster
119 0

热门文章

最新文章