首页 > 解决方案 > 自动缩放 Google Cloud Kubernetes

问题描述

我们有一个在 Google Cloud Kubernetes 集群下运行的应用程序,在我的测试场景中运行良好。我们为这些 Pod 设置了自动缩放——我们可能永远不需要降到 0,但希望它(目前)扩展到 20 个 Pod,然后再缩减,很明显。我们正在使用 faas-cli 进行部署。首先,尝试:

faas-cli deploy --replace --update=false -f ./process-listing-image.yml \
    --gateway=https://openfaas.ihouseprd.com \
    --label "com.openfaas.scale.min=1" \
    --label "com.openfaas.scale.max=20" \
    --label "com.openfaas.scale.factor=5"

但这给了我们 1 个吊舱,并且从未移动过。建议使用:

faas-cli deploy --replace --update=false -f ./process-listing-image.yml \
    --gateway=https://openfaas.ihouseprd.com \
    --label "com.openfaas.scale.min=0" \
    --label "com.openfaas.scale.max=20" \
    --label "com.openfaas.scale.factor=5"

但这仍然给了我们一个吊舱。我最近尝试过:

faas-cli deploy --replace --update=false -f ./process-listing-image.yml \
    --gateway=https://openfaas.ihouseprd.com \
    --label "com.openfaas.scale.min=5" \
    --label "com.openfaas.scale.max=20" \
    --label "com.openfaas.scale.factor=5"

它产生了 5 个 pod,但尽管有数千个请求在等待,但它的规模并没有超出这个范围。查看 Cloud Console 的“部署详细信息”屏幕,我看到了五个 pod,但无法判断所有 5 个是否都在工作。

知道为什么这些东西没有缩放吗?

标签: kubernetesgoogle-cloud-platformopenfaas

解决方案


推荐阅读