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.
Node pools use a NodeConfig specification. Each node in the pool has a Kubernetes node label, cloud.google.com/gke-nodepool , which has the node pool's name as its value. When you create a cluster, the number of nodes and type of nodes that you specify are used to create the first node pool of the cluster.
Node pools allow association of processing nodes based on their characteristics. You can explicitly specify a pools list for a node. Node pools allow association of processing nodes based on their characteristics.
List node pools in the managed Kubernetes cluster. To get list of nodes in the cluster run kubectl get nodes command.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With