How do you delete a label from a Kubernetes node?

First if you created a label for a node:

$ kubectl label node <nodename> <labelname>=<value>

My example, I’m working on Ceph on Kubernetes.

$ kubectl label node ceph-mon=enabled ceph-mgr=enabled

delete above labels from its node

$ kubectl label node <nodename> <labelname>-

My example to remove my Ceph labels

$ kubectl label node ceph-mon- ceph-mgr-

Now we can verify the labels were removed

$ kubectl get nodes --show-labels
NAME                            STATUS    ROLES     AGE       VERSION   LABELS           Ready     master    15d       v1.9.4,,,       Ready         1d        v1.9.4,,       Ready         1d        v1.9.4,,

and we’ll see that the labels are no longer present.

That should do it.