k8s污点添加删除和nodeSelector调度pod
k8s 污点、nodeSelector调度
·
查看node节点标签
$ kubectl get nodes --show-labels
node5.production.k8s Ready <none> 123d v1.17.0 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=node5.production.k8s,kubernetes.io/os=linux
deployment以nodeSelector作为调度规则
imagePullSecrets:
- name: zzmed-registry
volumes:
- hostPath:
name: local-app-log
path: /log/app
nodeSelector:
kubernetes.io/hostname: node5.production.k8s
添加污点
$ kubectl taint node node5.production.k8s node-for=cronjob:NoSchedule
查看污点
$ kubectl describe nodes node5.production.k8s|grep -i taint
Taints: node-for=cronjob:NoSchedule
删除污点
$ kubectl taint node node5.production.k8s node-for-
node/node5.production.k8s untainted
deployment以污点作为调度规则
imagePullSecrets:
- name: zzmed-registry
tolerations:
- effect: NoSchedule
key: node-for
operator: Equal
value: cronjob
volumes:
- hostPath:
path: /log/app
name: local-app-log
更多推荐
已为社区贡献19条内容
所有评论(0)