K8S指定节点部署服务
K8S指定节点部署服务方法一spec:containers:- name: container-nameimage: '102.196.12.16/hub/abc:v1'env:- name: LANGvalue: zh_CN.UTF-8resources:limits:memory: 4
·
K8S指定节点部署服务
方法一
spec:
containers:
- name: container-name
image: '102.196.12.16/hub/abc:v1'
env:
- name: LANG
value: zh_CN.UTF-8
resources:
limits:
memory: 4Gi
requests:
memory: 2Gi
nodeSelector:
kubernetes.io/hostname: node的IP或主机名
方法二
kubectl get node --show-labels # 查看标签
kubectl label nodes <node-name> <label-key>=<label-value> # 给node添加标签
kubectl label nodes <node-name> <label-key>=<label-value> --overwrite # 修改标签的值
kubectl label nodes <node-name> <label-key>- # 移除标签
spec:
containers:
- name: container-name
image: '102.196.12.16/hub/abc:v1'
env:
- name: LANG
value: zh_CN.UTF-8
resources:
limits:
memory: 4Gi
requests:
memory: 2Gi
nodeSelector:
<label-key>: <label-value>
更多推荐
已为社区贡献3条内容
所有评论(0)