kubernetes - 具有 2 个或更多指标的 kubernetes HPA 如何表现 - 特别是副本数计算?

标签 kubernetes autoscaling google-kubernetes-engine

我们已配置为对 HPA 使用 2 个指标

  • CPU 使用率
  • 应用特定的自定义指标

  • 在测试时,我们观察到了扩展的发生,但是副本数量的计算不是很清楚。我无法找到有关此的任何文档。

    问题:
  • 有人可以指出计算部分的文档或代码吗?
  • 使用多个指标进行扩展是一个好习惯吗?

  • 提前致谢!

    最佳答案

    来自 https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#how-does-the-horizontal-pod-autoscaler-work

    If multiple metrics are specified in a HorizontalPodAutoscaler, this calculation is done for each metric, and then the largest of the desired replica counts is chosen. If any of those metrics cannot be converted into a desired replica count (e.g. due to an error fetching the metrics from the metrics APIs), scaling is skipped.

    Finally, just before HPA scales the target, the scale recommendation is recorded. The controller considers all recommendations within a configurable window choosing the highest recommendation from within that window. This value can be configured using the --horizontal-pod-autoscaler-downscale-stabilization-window flag, which defaults to 5 minutes. This means that scaledowns will occur gradually, smoothing out the impact of rapidly fluctuating metric values

    关于kubernetes - 具有 2 个或更多指标的 kubernetes HPA 如何表现 - 特别是副本数计算?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54302592/

    相关文章:

    google-kubernetes-engine - Cloud Composer 结构化日志记录到 Stackdriver

    kubernetes - minikube kubectl 错误 : Unable to connect to server

    kubernetes - 使用 Terraform 创建多个命名空间

    java - CloudBees 和 App Cells、实例和池

    Redis Pub/Sub 当 sub 是自动缩放组的一部分时

    kubernetes - 有没有办法根据在 Google Container Registry 中创建的新镜像自动部署到 GCE?

    security - 我应该为 Kubernetes 禁用 TCP 时间戳吗?

    kubernetes - 从 Kube State Metrics 中提取指标时如何在 Prometheus 中获取 Pod 的标签

    amazon-web-services - 有什么方法可以编辑在 AWS 中用于自动扩展的 AMI?

    kubernetes - 某些东西在自定义 k8s 命名空间中重新创建了 ConfigMap