pod容器固定到指定节点
先查看节点名称
[root@node1 ~]# kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-work4 Ready work4 2y v1.11.1
k8s-work6 Ready work6 2y v1.11.1
node1 Ready master 3y v1.11.1
node2 Ready master 3y v1.11.1
node3 Ready master 3y v1.11.1
node4 Ready node4 91d v1.11.1
node5 Ready node5 324d v1.11.1
node7 Ready node7 84d v1.11.1
node8 Ready node8 215d v1.11.1
修改yaml文件
下面是通过label-selector机制选择节点
kubectl label node k8s-node1 type=node1
kubectl get nodes --show-labels