首页 > 代码库 > k8s调度-指定node

k8s调度-指定node

1、给node加标签

kubectl label nodes k8s-slave2 slave=184

2、查看标签

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

3、rc文件中指定NodeSelector

apiVersion: v1kind: ReplicationControllermetadata:  name: centos-master  labels:    name: centos-masterspec:  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