解决 K8s 报错 nodes had untolerated taint 污点排查指南
分析 Kubernetes Pod 处于 Pending 且事件提示 nodes had untolerated taint 的排查方法,提供容忍度配置与污点清除方案。
问题现象
新创建的 Pod 一直停留在 Pending 状态,kubectl describe pod 的 Events 中显示:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 15s default-scheduler 0/3 nodes are available: 3 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }.
触发根因
- 集群中的节点配置了污点(Taints,如 Master/Control-Plane 默认具有
NoSchedule污点)。 - Pod 清单中未声明对应的容忍度(Tolerations),调度器出于安全隔离保护,拒绝将普通工作负载调度到该节点上。
- 节点发生了故障(如网络断开),自动被内核打上了
node.kubernetes.io/unreachable:NoSchedule系统污点。
解决步骤与操作命令
步骤一:查看集群各节点的真实污点清单
kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints
步骤二:方案 A —— 为 Pod 声明对应的容忍度(Tolerations)
若该服务确实需要运行在控制平面节点(如网络插件或监控 Agent):
spec:
tolerations:
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"
步骤三:方案 B —— 移除工作节点上的误打污点(针对单节点集群)
若在开发测试单节点集群(All-in-One)上部署:
kubectl taint nodes --all node-role.kubernetes.io/control-plane:NoSchedule-
末尾带有减号 - 表示从节点上彻底删除该污点。
验证确认
再次观察 Pod 调度状态:
kubectl get pods -w
default-scheduler 立即完成节点匹配绑定,Pod 顺利由 Pending 转为 Running。


