<p>Is it possible to use <code>gcloud container cluster create</code> to create a node pool for GKE using <strong>custom</strong> machine types (<a href="https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type" rel="noreferrer">https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type</a>)?</p>

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

<p>I know this is possible in the UI, but I want to wrap this <code>gcloud</code> command in a script.</p>

<p>Seems like you are trying to use <em>custom machine types</em> rather than <a href="https://cloud.google.com/compute/docs/machine-types#standard_machine_types" rel="noreferrer">standard machine types</a> and want to use <a href="https://cloud.google.com/sdk/gcloud/reference/container/clusters/create" rel="noreferrer">gcloud command</a> for it like <code>gcloud container cluster create</code>.</p>

<p>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</p>

<blockquote>
  <p>--machine-type “custom-{cpus}-{MiB-ram}”</p>
</blockquote>

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

<p><code>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" ......</code></p>

<p>Hope this helps.</p>
