gpt4 book ai didi

google-compute-engine - 在 GKE 集群创建时启用自动扩缩

转载 作者:行者123 更新时间:2023-12-01 03:28:56 24 4
gpt4 key购买 nike

我尝试在 GKE 上创建一个自动缩放的容器集群。
当我使用“--enable-autoscaling”选项时(如此处的文档所示:https://cloud.google.com/container-engine/docs/clusters/operations#create_a_cluster_with_autoscaling):

$ gcloud container clusters create mycluster --zone $GOOGLE_ZONE --num-nodes=3 --enable-autoscaling --min-nodes=2 --max-nodes=5

但 MIG(托管实例组)未显示为“自动缩放”,如 Web 界面和以下命令的结果所示:
$ gcloud compute instance-groups managed list
NAME SIZE TARGET_SIZE AUTOSCALED
gke-mycluster... 3 3 no

为什么 ?

然后,我尝试了 kubernetes 文档( http://kubernetes.io/docs/admin/cluster-management/#cluster-autoscaling )中指出的另一种方式,但显然出现了由“=true”引起的错误:
$ gcloud container clusters create mytestcluster --zone=$GOOGLE_ZONE --enable-autoscaling=true --min-nodes=2 --max-nodes=5 --num-nodes=3
usage: gcloud container clusters update NAME [optional flags]
ERROR: (gcloud.container.clusters.update) argument --enable-autoscaling: ignored explicit argument 'true'

医生在这方面有错吗?
这是我的 gcloud 版本结果:
$ gcloud version
Google Cloud SDK 120.0.0
beta 2016.01.12
bq 2.0.24
bq-nix 2.0.24
core 2016.07.29
core-nix 2016.03.28
gcloud
gsutil 4.20
gsutil-nix 4.18
kubectl
kubectl-linux-x86_64 1.3.3

最后一个精度:自动缩放器在集群的描述中似乎“开启”:
$ gcloud container clusters describe  mycluster | grep auto -A 3
- autoscaling:
enabled: true
maxNodeCount: 5
minNodeCount: 2

有什么想法可以解释这种行为吗?

最佳答案

Kubernetes 集群自动缩放不使用托管实例组自动缩放程序。它运行一个 cluster-autoscaler Kubernetes master 上的 Controller ,它使用 Kubernetes 特定的信号来扩展节点。 The codeautoscaler如果您想要更多信息,请 repo 。

我也发了a PR修复自动缩放文档中的无效标志用法。谢谢你捕获那个!

关于google-compute-engine - 在 GKE 集群创建时启用自动扩缩,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39454375/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com