Add or edit label on existing node pool in GKE

3/21/2019

I created GKE cluster with node pool, but I forgot to label the nodes... In Google Cloud Platform UI I can't edit or add Kubernetes labels for the existing node pool... How can I do it without recreating whole node pool?

The label field is unchangeable

-- malcolm
google-kubernetes-engine
kubernetes

2 Answers

3/21/2019

You can edit your node configuration, including labels, with kubectl:

kubectl edit node <your node name>

Use kubectl get node to get a list of your nodes. If you're having trouble connecting to your GKE cluster check out the docs here.

-- Aleksi
Source: StackOverflow

3/23/2019

It isn't possible to edit the labels without recreating nodes, so GKE does not support updating labels on node pools.

In GKE, the Kubernetes labels are applied to nodes by the kubelet binary which receives them as flags passed in via the node startup script. As it is just as disruptive (or more disruptive) to recreate all nodes in a node pool as to create a new node pool, updating the labels isn't a supported operation for updating a node pool.

-- Robert Bailey
Source: StackOverflow