3

k8s 调度指定节点

 1 year ago
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

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
  • 收藏
  • 评论
  • 分享
  • 举报

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK