K8S Add Remove label to node, and according to label filter nodes

Add to

  1. kubectl label nodes kube- node label_name=label_value
    kubectl label nodes 1.1.1.1 label_name=label_value

 

Inquire

  1. kubectl get node -a -l "node=kube-node"
     

Delete a Label, only the last specified on the command line and the name of the Label key can be connected with a minus sign:
$ kubectl Nodes label 1.1.1.1 role- 

modify the value of a Label, --overwrite need to add parameters:
$ kubectl label nodes 1.1.1.1 role = apache --overwrite

Or you can directly kubectl edit can edit this node configuration, save and exit on it!

Guess you like

Origin www.cnblogs.com/zealousness/p/11120412.html