kubernetes pod處理pedding狀態

命令:kubectl describe pod <podname> ,<podname>爲pedding的pod.

看到的錯誤提示爲:0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate

 

kubernetes增加污點,達到pod是否能在做節點運行

master node參與工作負載 (只在主節點執行)
使用kubeadm初始化的集羣,出於安全考慮Pod不會被調度到Master Node上,也就是說Master Node不參與工作負載。

這裏搭建的是測試環境可以使用下面的命令使Master Node參與工作負載:
k8s是master節點的hostname
允許master節點部署pod,使用命令如下:

kubectl taint nodes --all node-role.kubernetes.io/master-
輸出如下:

node “k8s” untainted

輸出error: taint “node-role.kubernetes.io/master:” not found錯誤忽略。

禁止master部署pod

kubectl taint nodes k8s node-role.kubernetes.io/master=true:NoSchedule
 

最後重啓Kubectl

命令:systemctl restart kubectl

重新查看Pod

kubectl get pods -A

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章