1、查看标签 kubectl get nodes --show-labels 2、打标签 kubectl label nodes node1.com kong=true kubectl label nodes node2.com kong=true kubectl label nodes node3.com kong=true 3、pod添加亲和性 spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kong operator: In values: - "true"
4、删除label
kubectl label nodes node1.com kong-