k8s 调度指定节点

风流不在谈锋胜,袖手无言味最长。这篇文章主要讲述k8s 调度指定节点相关的知识,希望能为你提供帮助。
1.根据节点名字调度

spec:
nodeName: k8s-node1
containers:
- name: nginx
image: nginx



【k8s 调度指定节点】2.根据标签调度
#打标签
kubectl label nodeskub101 app1=mysql

#确认标签是都生效
kubectl get nodes --show-labels


#
spec:
nodeSelector:
deploy.type: assembly_app
restartPolicy: Always
containers:
- name: nginx
image: "nginx"

spec:
nodeSelector:
app1: mysql
containers:
- name: nginx
image: nginx


    推荐阅读