Kubernetes vs Google 容器引擎:如何使用自动缩放?

Kubernetes vs Google Container Engine: How to use autoscaling?

我已经使用 Kubernetes 将应用程序部署到 Google 云容器引擎集群。

我进入了自动缩放,我发现了以下选项:

Kubernetes 水平 Pod 自动缩放 (HPA)

explained here, Kubernetes offers the HPA on deployments. As per the docs:

Horizontal Pod Autoscaling automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization

Google 云容器集群

现在我有一个 Google 云容器集群,使用 3 个实例,并启用了自动缩放。根据 docs:

Cluster Autoscaler enables users to automatically resize clusters so that all scheduled pods have a place to run.

这意味着我有两个地方可以定义我的自动缩放。因此我的问题是:

非常感谢!

Is a Pod the same as VM instance inside my cluster, or can multiple Pod's run inside a single VM instance?

多个Pods可以运行同一个实例(在kuberenetes中称为节点)。您可以在部署 yaml 中定义 POD 消耗的最大资源。参见docs。这是自动缩放的重要先决条件。

Are these two parameters doing the same (aka creating/removing VM instances inside my cluster). If not, what is their behaviour compared to one another?

Kubernetes 自动缩放器将在您现有的节点中安排额外的 PODs。 Google autoscaler 会将工作节点(新实例)添加到您的集群。 Google autoscaler 查看排队的 PODs 无法安排,因为您的集群中没有 space,当它找到这些节点时将添加节点。

What happens if e.g. I have a number of pods between 3 and 10 and a cluster with number of instances between 1 and 3 and autoscaling kicks in. When and how would both scale?

根据您为 pods google 定义的最大资源使用量,自动缩放器将估计需要多少新节点才能运行 全部排队,计划 pods。

另请参阅此 article