0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate.报错
这是因为k8s集群默认不让在master节点创建pod,也就是说Master Node不参与工作负载。
当前的master节点被打上了node-role.kubernetes.io/master:NoSchedule
的污点:
[root@k8s-master k8s]# kubectl describe nodes k8s-master |grep -E '(Roles|Taints)'
①允许master部署pod
[root@k8s-master nginx]# kubectl taint nodes k8s-master node-role.kubernetes.io/master-
node/k8s-master untainted
②禁止master部署pod
[root@k8s-master]# kubectl taint nodes k8s node-role.kubernetes.io/master=true:NoSchedule