I am trying to create a GKE cluster with custom node-pool name. I am able to create from GUI but not find any option in gcloud to change default pool-name. Can any one help me to customize default pool name while creating GKE cluster through gcloud cli? Thanks
-
Just as a kind reminder take a look here https://stackoverflow.com/help/someone-answers , if you find my answer useful, please consider upvoting/accepting it, thank you! – Jose Luis Delgadillo Feb 23 '21 at 18:48
1 Answers
To rename the default node pool at the creation of a GKE cluster is not possible neither when you have the cluster created. With gcloud container node-pools update you can modify the following parameters:
gcloud container node-pools update NAME (--node-locations=ZONE,[ZONE,…] | --system-config-from-file=SYSTEM_CONFIG_FROM_FILE | --workload-metadata=WORKLOAD_METADATA | --enable-autoprovisioning --enable-autoscaling --max-nodes=MAX_NODES --min-nodes=MIN_NODES | --enable-autorepair --enable-autoupgrade | --max-surge-upgrade=MAX_SURGE_UPGRADE --max-unavailable-upgrade=MAX_UNAVAILABLE_UPGRADE) [--cluster=CLUSTER] [--region=REGION | --zone=ZONE, -z ZONE] [GCLOUD_WIDE_FLAG …]
But not the name.
The workaround is:
- Create a new nodepool with the desired name. This is just an example I got from this document it is to change the machine type but it also works to create a new nodepool with another name.
gcloud container node-pools create new-node-pool \
--cluster=mycluster\
--machine-type=e2-highmem-2 \
--num-nodes=5
- Cordon the existing node pool.
- Drain the existing node pool.
and then Delete the old nodepool.

- 494
- 2
- 10