Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GKE node pool custom machine type CLI

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.

like image 781
Tony Avatar asked Mar 12 '18 17:03

Tony


People also ask

How do you make a node pool in GKE?

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.

What is default node pool?

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.

How do you list node pools in Kubernetes?

List node pools in the managed Kubernetes cluster. To get list of nodes in the cluster run kubectl get nodes command.


1 Answers

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.

like image 165
Taher Avatar answered Oct 04 '22 05:10

Taher