码迷,mamicode.com
首页 > 其他好文 > 详细

k8s调度-指定node

时间:2016-08-31 20:15:39      阅读:1885      评论:0      收藏:0      [点我收藏+]

标签:

1、给node加标签

kubectl label nodes k8s-slave2 slave=184

2、查看标签

[root@k8s_master centos7]# kubectl describe node k8s-slave2
Name:            k8s-slave2
Labels:            beta.kubernetes.io/arch=amd64
            beta.kubernetes.io/os=linux
            kubernetes.io/hostname=k8s-slave2
            slave=184
Taints:            <none>
CreationTimestamp:    Wed, 31 Aug 2016 17:42:09 +0800

3、rc文件中指定NodeSelector

apiVersion: v1
kind: ReplicationController
metadata:
  name: centos-master
  labels:
    name: centos-master
spec:
  replicas: 1
  selector:
    name: centos-master
  template:
    metadata:
      labels:
        name: centos-master
    spec:
      containers:
      - name: centos
        image: 10.10.30.180/library/centos7:v1
      nodeSelector:
        slave: "184"

 

k8s调度-指定node

标签:

原文地址:http://www.cnblogs.com/puroc/p/5827129.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!