首页 > 其他分享 >k8s master不可以被调度,修改deploy配置让这个可以单独调度上去

k8s master不可以被调度,修改deploy配置让这个可以单独调度上去

时间:2024-03-02 18:58:32浏览次数:21  
标签:node kubernetes deploy 调度 role io master

给两个节点添加标签,让pod调度上去,但是kubectl describe pod  发现报错了,因为master不可以被调度,kube002也是设置了污点禁止被调度了

  Warning  FailedScheduling  4m33s (x2 over 9m34s)  default-scheduler  0/4 nodes are available:

1 node(s) had untolerated taint {key: kube002}, 1 node(s) had untolerated taint {node-role.kubernetes.io/master: },
2 node(s) didn't match Pod's node affinity/selector. preemption: 0/4 nodes are available: 4 Preemption is not helpful for scheduling..

查看不可以被调度,master节点

# kubectl describe node vm-qa-kubemaster001.xxm |grep -i schedulable
Unschedulable:      false

查看污点键值对

#kubectl describe node vm-qa-kubemaster001.zz.apus.com
Taints:             node-role.kubernetes.io/master:NoSchedule

这表示该节点有一个污点,键为node-role.kubernetes.io/master,值为空,效果为NoSchedule

 

添加污点容忍度,指定调度节点

apiVersion: v1  
kind: Pod  
metadata:  
  name: my-pod  
spec:  
  containers:  
    - name: my-container  
      image: my-image  
  tolerations:  
    - key: "node-role.kubernetes.io/master"  
      operator: "Equal"  
      value: ""  
      effect: "NoSchedule"  
  nodeName: "vm-qa-kubemaster001.xxxm"

 新增如下:

  tolerations:  
    - key: "node-role.kubernetes.io/master"  
      operator: "Equal"  
      value: ""  
      effect: "NoSchedule"  
  nodeName: "vm-qa-kubemaster001.xxxm"

 

标签:node,kubernetes,deploy,调度,role,io,master
From: https://www.cnblogs.com/machangwei-8/p/18049053

相关文章