root@k8s-master:~# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master Ready master 50d v1.11.2 k8s-node1 NotReady <none> 50d v1.11.2 k8s-node2 NotReady <none> 50d v1.11.2
root@k8s-master:~# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master Ready <none> 50d v1.11.2 k8s-node1 NotReady <none> 50d v1.11.2 k8s-node2 NotReady <none> 50d v1.11.2
没错, 连 master 节点的标记都没有, 我们可以手动给任意 node 设置 ROLES
原理就是给 node 打标签, 只不过是特殊的标签
1 2 3 4 5 6 7 8 9 10 11 12 13
root@k8s-master:~# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master Ready master 50d v1.11.2 k8s-node1 NotReady <none> 50d v1.11.2 k8s-node2 NotReady <none> 50d v1.11.2 root@k8s-master:~# kubectl label node k8s-node1 node-role.kubernetes.io/worker=worker node/k8s-node1 labeled root@k8s-master:~# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master Ready master 50d v1.11.2 k8s-node1 NotReady worker 50d v1.11.2 k8s-node2 NotReady <none> 50d v1.11.2 root@k8s-master:~#