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 kublaxnode3.example.com 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 kublaxprodnode1.example.com ceph-mon- ceph-mgr-
Now we can verify the labels were removed
$ kubectl get nodes --show-labels
NAME STATUS ROLES AGE VERSION LABELS
kubadm1.example.com Ready master 15d v1.9.4 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=kubadm1.example.com,node-role.kubernetes.io/master=
kublaxnode3.example.com Ready 1d v1.9.4 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=kublaxnode3.example.com
kublaxnode4.example.com Ready 1d v1.9.4 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=kublaxnode4.example.com
and we’ll see that the labels are no longer present.
That should do it.