kubectl taint nodes --all node-role.kubernetes.io/master-

  

部署nginx pod,yaml文件

apiVersion: v1
kind: Pod
metadata:
        name: nginx
        labels:
                app: nginx
spec:
        containers:
        - name: nginx
          image: nginx:alpine
          ports:
          - containerPort: 80

kubectl create -f nginx-pod.yaml

  使用kubectl describe pod nginx

提示  1 node(s) had taints that the pod didn't tolerate

原因 

master node参与工作负载 (只在主节点执行)
使用kubeadm初始化的集群,出于安全考虑Pod不会被调度到Master Node上,也就是说Master Node不参与工作负载。

这里搭建的是测试环境可以使用下面的命令使Master Node参与工作负载:

kubectl taint nodes --all node-role.kubernetes.io/master-

  

 

相关文章:

  • 2022-03-06
  • 2022-01-04
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2022-01-01
猜你喜欢
  • 2021-06-06
  • 2021-10-05
  • 2021-11-18
  • 2021-11-27
  • 2022-12-23
  • 2021-07-30
  • 2022-01-29
相关资源
相似解决方案