k8s去除污点节点

现象

1
2
3
4
5
6
7
8
9
10
11
12
13
# 查看节点详情
kubectl describe pods nginx-7b7485646b-n9f8g -n default

################报错信息##############

Node-Selectors:
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 2m54s default-scheduler 0/1 nodes are available: 1 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }.
preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling..

解决

1
2
3
4
5
6
7
root@k8s:~# kubectl describe nodes |grep Taints                                                                                                      
Taints: node-role.kubernetes.io/control-plane:NoSchedule

root@k8s:~# kubectl get node
NAME STATUS ROLES AGE VERSION
k8s Ready control-plane 4h22m v1.26.5
root@k8s:~# kubectl taint nodes k8s node-role.kubernetes.io/control-plane-

https://github.com/zznn-cloud/zznn-cloud-blog-images/raw/main/Qexo/24/3/image_169b466f0666661a0ccb13ce6795653b.png