How to label Kubernetes node ROLE name

That’s easy!

Add Label:

kubectl label node <node name> node-role.kubernetes.io/<role name>=<key — (any name)>

Remove label:

kubectl label node <node name> node-role.kubernetes.io/<role name>-

Let’s try:

$ kubectl get nodes

$ kubectl label node node-2.domain.loc node-role.kubernetes.io/worker=

and check:

$ kubectl get nodes

Leave a Reply

Your email address will not be published. Required fields are marked *