Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete a node label by command and api?

Tags:

kubernetes

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?

like image 977
ttyyll Avatar asked Dec 03 '15 14:12

ttyyll


People also ask

How do I delete a node in Kubernetes?

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.

How do I check node labels?

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.


1 Answers

create labels for the nodes:

kubectl label node <nodename> <labelname>=allow

delete above labels from its respecitve nodes:

kubectl label node <nodename> <labelname>-

like image 102
Gaurav Gharat Avatar answered Sep 24 '22 06:09

Gaurav Gharat