如何在不同区域获取 GKE 节点池(分区集群)

huangapple go评论134阅读模式
英文:

How to get a GKE node pool in different zone than cluster (zonal cluster)

问题

我有一个位于 us-central1-c 区域的 GKE 集群,并想向其添加一个 L4 节点池。

我目前使用 Terraform 进行维护,设置节点池的 location 似乎被 Terraform 忽略了,并且它尝试在集群的原始区域中找到机器类型。

> 错误: 创建 NodePool 时出错: googleapi: 错误 400: 在区域 us-central1-c 中的无效机器类型 g2-standard-16:googleapi: 错误 404: 未找到资源 'projects/isolate-dev-smiling-shark/zones/us-central1-c/machineTypes/g2-standard-16',notFound.,badRequest

所以我发现 G2 机器仅在 us-central1-aus-central1-b 中可用。

❯ gcloud compute machine-types list --zones=us-central1-a | grep g2 
g2-standard-12    us-central1-a  12    48.00 
g2-standard-16    us-central1-a  16    64.00 
g2-standard-24    us-central1-a  24    96.00 
g2-standard-32    us-central1-a  32    128.00 
g2-standard-4     us-central1-a  4     16.00 
g2-standard-48    us-central1-a  48    192.00 
g2-standard-8     us-central1-a  8     32.00 
g2-standard-96    us-central1-a  96    384.00

❯ gcloud compute machine-types list --zones=us-central1-c | grep g2

❯ 

我进入界面尝试手动创建这样一个节点池,但我无法选择机器类型。

是否可以在 us-central1-c 区域拥有一个分区集群和 us-central1-a 区域的节点池,如何实现?

如果不行,将整个集群迁移到 us-central1-a,推荐采取什么措施?(我真的不想这样做)。

英文:

I have a GKE cluster in us-central1-c zone and I wanted to add an L4 node pool to it.

I currently use Terraform to maintain this and setting the location of the node pool seems to be ignored by Terraform and it tries to find the machine type in the cluster's original zone.

> Error: error creating NodePool: googleapi: Error 400: Invalid machine type g2-standard-16 in zone us-central1-c: googleapi: Error 404: The resource 'projects/isolate-dev-smiling-shark/zones/us-central1-c/machineTypes/g2-standard-16' was not found, notFound., badRequest

So I figured out G2 machines are only available in us-central1-a and us-central1-b.

❯ gcloud compute machine-types list --zones=us-central1-a | grep g2
g2-standard-12    us-central1-a  12    48.00
g2-standard-16    us-central1-a  16    64.00
g2-standard-24    us-central1-a  24    96.00
g2-standard-32    us-central1-a  32    128.00
g2-standard-4     us-central1-a  4     16.00
g2-standard-48    us-central1-a  48    192.00
g2-standard-8     us-central1-a  8     32.00
g2-standard-96    us-central1-a  96    384.00


❯ gcloud compute machine-types list --zones=us-central1-c | grep g2


❯

I went into the UI and tried to create such a node pool by hand and I am not able to select the machine type.

Is it possible to have a zonal cluster in us-central1-c and a node pool in us-central1-a and how could I achieve it?

If not, what would be the recommended course of action to move the whole cluster to us-central1-a? (I would really prefer not having to do this).

答案1

得分: 1

g2-machine类型不存在于us-central1-c。

如在区域性集群文档中所述

要在您的区域性集群中运行 GPU,请选择至少有一个请求的 GPU 可用的区域。创建节点池时,您必须使用 --node-locations 标志来指定包含请求的 GPU 的区域或区域。

如果需要,您可以更改或编辑集群的区域,这将导致所有新的和现有节点跨越这些区域,并添加 L4 机型。

请注意,您不能从分区式更改为区域性,或从区域性更改为分区式集群类型

英文:

g2-machine types do not exist on us-central1-c.

As stated in the regional cluster documentation

> To run GPUs in your regional cluster, choose a region that has at least one zone where the requested GPUs are available. You must use the --node-locations flag when creating the node pool to specify the zone or zones containing the requested GPUs.
>
> If you need to, you can change or edit a cluster's zones, which causes
> all new and existing nodes to span those zones, and add the L4 machine
> types.

Do note that you cannot change it from zonal to regional, or regional to zonal cluster type.

huangapple
  • 本文由 发表于 2023年5月30日 06:03:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76360546.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定