I have a GKE cluster in us-central1-c
zone and I wanted to add an L4 node pool to it.
I currently use Terraform to maintain this and setting the location
of the node pool seems to be ignored by Terraform and it tries to find the machine type in the cluster's original zone.
Error: error creating NodePool: googleapi: Error 400: Invalid machine type
g2-standard-16
in zoneus-central1-c
: googleapi: Error 404: The resource'projects/isolate-dev-smiling-shark/zones/us-central1-c/machineTypes/g2-standard-16'
was not found, notFound., badRequest
So I figured out G2 machines are only available in us-central1-a
and us-central1-b
.
❯ gcloud compute machine-types list --zones=us-central1-a | grep g2
g2-standard-12 us-central1-a 12 48.00
g2-standard-16 us-central1-a 16 64.00
g2-standard-24 us-central1-a 24 96.00
g2-standard-32 us-central1-a 32 128.00
g2-standard-4 us-central1-a 4 16.00
g2-standard-48 us-central1-a 48 192.00
g2-standard-8 us-central1-a 8 32.00
g2-standard-96 us-central1-a 96 384.00
❯ gcloud compute machine-types list --zones=us-central1-c | grep g2
❯
I went into the UI and tried to create such a node pool by hand and I am not able to select the machine type.
Is it possible to have a zonal cluster in us-central1-c
and a node pool in us-central1-a
and how could I achieve it?
If not, what would be the recommended course of action to move the whole cluster to us-central1-a
? (I would really prefer not having to do this).
g2-machine types do not exist on us-central1-c.
As stated in the regional cluster documentation
To run GPUs in your regional cluster, choose a region that has at least one zone where the requested GPUs are available. You must use the --node-locations flag when creating the node pool to specify the zone or zones containing the requested GPUs.
If you need to, you can change or edit a cluster's zones, which causes all new and existing nodes to span those zones, and add the L4 machine types.
Do note that you cannot change it from zonal to regional, or regional to zonal cluster type.