本文介绍了Horizo​​ntal Pod Autoscaler中API版本v2beta1和v2beta2之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://中的Kubernetes水平Pod自动缩放器演练kubernetes.io/docs/tasks/run-application/horizo​​ntal-pod-autoscale-walkthrough/解释说,我们可以对自定义指标执行自动缩放.我不了解的是何时使用两个API版本:v2beta1和v2beta2.如果有人可以解释,我将非常感谢.

The Kubernetes Horizontal Pod Autoscaler walkthrough in https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/ explains that we can perform autoscaling on custom metrics. What I didn't understand is when to use the two API versions: v2beta1 and v2beta2. If anybody can explain, I would really appreciate it.

谢谢.

推荐答案

第一个指标 autoscaling/V2beta1 不允许您基于自定义指标来缩放广告连播.这仅允许您基于CPUmemory对应用程序的利用率来扩展应用程序

The first metrics autoscaling/V2beta1 doesn't allow you to scale your pods based on custom metrics. That only allows you to scale your application based on CPU and memory utilization of your application

第二个指标 autoscaling/V2beta2 允许用户根据自定义指标进行自动缩放.它允许基于来自Kubernetes外部的指标进行自动缩放.在此api中添加了新的外部"指标来源.

The second metrics autoscaling/V2beta2 allows users to autoscale based on custom metrics. It allow autoscaling based on metrics coming from outside of Kubernetes. A new External metric source is added in this api.

metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 50

它将基于度量标准名称和标签选择器来标识要自动缩放的特定度量标准.这些指标可以来自堆栈驱动程序或Prometheus监视应用程序之类的任何位置,并且可以基于您想扩展应用程序的Prometheus的某些查询得出.

It will identify a specific metric to autoscale on based on metric name and a label selector. Those metrics can come from anywhere like a stackdriver or prometheus monitoring application and based on some query from prometheus you want to scale your application.

始终最好使用V2beta2 api,因为它可以在CPU和内存以及自定义指标上进行缩放,而V2beta1 API仅可以在内部指标上进行缩放.

It would always better to use V2beta2 api because it can do scaling on CPU and memory as well as on custom metrics, while V2beta1 API can scale only on internal metrics.

我在答案中提到的代码段表示如何在V2beta2 API中指定目标CPU利用率

The snippet I mentioned in answer denotes how you can specify the target CPU utilisation in V2beta2 API

这篇关于Horizo​​ntal Pod Autoscaler中API版本v2beta1和v2beta2之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 21:19