Skip to main content
In this tutorial, you’ll learn how to manage labels on Google Kubernetes Engine (GKE) clusters and their node pools. You will:
  1. Create a new GKE cluster with labels
  2. View labels on an existing cluster
  3. Update labels on a cluster
  4. Remove labels from a cluster
  5. Verify labels on both the cluster and its node pools
  6. Understand how cluster-level label changes affect node pools

Table of Contents


1. Create a New Cluster with a Label

Spin up a GKE cluster named gke-deep-dive-new with:
  • 1 node
  • 10 GB standard persistent disk
  • Label test=gke
This command provisions a single-node pool (HDD) and attaches the test=gke label at creation.

2. View Labels on an Existing Cluster

To inspect labels on a cluster (e.g., gke-deep-dive) run:
If there are no labels, the resourceLabels section will be empty.

3. Update Labels on an Existing Cluster

Add or modify labels using --update-labels. For example, set newlabel=gkeold on gke-deep-dive:
Verify the update:
Expected output:

4. Remove a Label from a Cluster

To delete a label, specify its key with --remove-labels:
Confirm removal:
The resourceLabels field should now be empty.

5. Verify Labels on the New Cluster

Check that gke-deep-dive-new has the test=gke label:
You should see:
Alternatively, filter with grep:

6. Remove the Label from the New Cluster

Remove the test label:
Verify:
resourceLabels will now be empty.

7. Node Pool Labels Remain After Cluster Label Removal

Cluster-level label updates do not automatically propagate to existing node pools. Even after removing test from the cluster, the default node pool still holds its label:
To remove a label from the node pool itself:
After detaching a label from the cluster, always verify node-pool labels if you rely on them for workloads, autoscaling, or monitoring.

Command Reference


Watch Video