3
k8s 调度指定节点
source link: https://blog.51cto.com/u_13824604/5372482
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
k8s 调度指定节点
原创1.根据节点名字调度
spec:
nodeName: k8s-node1
containers:
- name: nginx
image: nginx
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
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
- 赞
- 收藏
- 评论
- 分享
- 举报
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK