k8s调度-指定node

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"

 

posted @ 2016-08-31 18:35  puroc  阅读(9298)  评论(0编辑  收藏  举报