出于安全考虑,默认配置下Kubernetes不会将Pod调度到Master节点。
#查看k8s-master表示不运行pod
[root@k8s-master ~]# kubectl describe node k8s-master |grep Taints
Taints: node-role.kubernetes.io/master:NoSchedule
#查看k8s-master表示运行pod
[root@k8s-master ~]# kubectl describe node k8s-master |grep Taints
Taints: <none>
#让 master节点参与POD负载的命令为
kubectl taint nodes k8s-master node-role.kubernetes.io/master-
#让 master节点恢复不参与POD负载的命令为
kubectl taint nodes k8s-master node-role.kubernetes.io/master=:NoSchedule