简体   繁体   English

GKE节点池自定义机器类型CLI

[英]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 )? 是否可以使用gcloud container cluster create来使用自定义计算机类型为GKE创建节点池( 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). 而不是n1-standard-1 / etc,我想创建一个具有4个vCPU和8 GB内存的实例(例如)。

I know this is possible in the UI, but I want to wrap this gcloud command in a script. 我知道在UI中这是可能的,但我想在脚本中包装这个gcloud命令。

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 . 看起来您正在尝试使用自定义机器类型而不是标准机器类型,并希望像gcloud container cluster create一样使用gcloud命令

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 这实际上是由beta gcloud命令支持的,您可以通过指定机器类型来创建具有自定义机器的集群,如下所示

--machine-type “custom-{cpus}-{MiB-ram}” - 机器类型“custom- {cpus} - {MiB-ram}”

For the example you have provided 4 vCPU and 8 GB memory, the command would be something like 对于您提供4个vCPU和8 GB内存的示例,命令将类似于

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. 希望这可以帮助。

“gcloud container cluster create”命令有一个--machine-type标志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM