GKE node pool custom machine type CLI

3/12/2018

Is it possible to use gcloud container cluster create to create a node pool for GKE using custom machine types (https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type)?

Instead of n1-standard-1/etc, I would like to create an instance with 4 vCPU and 8 GB memory (for example).

I know this is possible in the UI, but I want to wrap this gcloud command in a script.

-- Tony
gcloud
google-cloud-platform
google-kubernetes-engine
kubernetes

2 Answers

3/13/2018

"gcloud container cluster create" command has a --machine-type flag.

-- Will Faris
Source: StackOverflow

3/13/2018

Seems like you are trying to use custom machine types rather than standard machine types and want to use gcloud command for it like gcloud container cluster create.

This is actually supported by a beta gcloud command and you can create a cluster with custom machines by specifying the machine type as below

--machine-type “custom-{cpus}-{MiB-ram}”

For the example you have provided 4 vCPU and 8 GB memory, the command would be something like

gcloud beta container --project [project name] clusters create [cluster name] --zone [zone name] --username [username] --cluster-version "1.8.7-gke.1" --machine-type "custom-4-8192" ......

Hope this helps.

-- Taher
Source: StackOverflow