#给节点打上标签
[root@lecode-k8s-master deployment]# kubectl label no lecode-dev-001 hostname=lecode-dev-001
[root@lecode-k8s-master deployment]# kubectl get no --show-labels
NAME STATUS ROLES AGE VERSION LABELS
lecode-dev-001 Ready <none> 17d v1.20.9 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,hostname=lecode-dev-001,kubernetes.io/arch=amd64,kubernetes.io/hostname=lecode-dev-001,kubernetes.io/os=linux
#yaml文件配置nodeselector
nodeSelector:
hostname: lecode-dev-001
标签:kubernetes,hostname,dev,节点,001,io,lecode,K8S,选择器
From: https://www.cnblogs.com/anslinux/p/16880458.html