1.根据节点名字调度
spec:
nodeName: k8s-node1
containers:
- name: nginx
image: nginx
2.根据标签调度
#打标签
kubectl label nodes kub101 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