Add label to nodes:
$ kubectl label nodes 10.xx.xx.xx key1=val1
If I want to delete label(key1=val1)
on node(10.xx.xx.xx), how can I delete by kubectl command and API?
To remove a Kubernetes Node:Log in to the Kubernetes Node that you want to remove. Log in to the Salt Master node. Log in to any Kubernetes Master node. Wait until the workloads are gracefully deleted and the Kubernetes Node is removed.
We use kubectl get nodes to list the available nodes in the cluster. Additionally we can use --show-labels arguments to also list the assigned labels to individual nodes in the cluster. Here you can see, now we have one additional field "LABELS" which shows the labels which are applied to individual nodes.
create labels for the nodes:
kubectl label node <nodename> <labelname>=allow
delete above labels from its respecitve nodes:
kubectl label node <nodename> <labelname>-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With