OpenShift中水平Pod自动缩放器的自定义指标 [英] custom metrics for horizontal pod autoscaler in OpenShift

查看:182
本文介绍了OpenShift中水平Pod自动缩放器的自定义指标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用使用kubernetes 1.2版的openshift v3.我正在探索有关自动缩放功能的更多信息.
目前,它说仅支持CPU指标.

I am using openshift v3 which uses kubernetes version 1.2. I am exploring more on autoscaling feature.
Currently it says only CPU metrics is supported.

openshift中的pod可以根据从内存中收集的内存或其他指标数据进行扩展吗?

Is there a way pods in openshift can be scaled based on memory or other metrics data collected from heapster?

推荐答案

从堆中收集的

或其他指标数据

or other metrics data collected from heapster

来自

From the announcements of Kubernetes 1.12, this should be now (Q4 2018) supported (albeit still in Beta).

Horizo​​ntal Pod Autoscaler中的

任意/自定义指标正在移至第二个Beta(autoscaling/v2beta2),以测试一些其他功能增强. 重新设计的水平Pod自动缩放器"功能包括对自定义指标和状态条件的支持.

Arbitrary / Custom Metrics in the Horizontal Pod Autoscaler is moving to a second beta (autoscaling/v2beta2) to test some additional feature enhancements. This reworked Horizontal Pod Autoscaler functionality includes support for custom metrics and status conditions.

请参见 kubernetes功能117

See kubernetes feature 117 and commit 9d84a49, and the new Horizontal Pod Autoscaler Walkthrough page update.

它介绍了标签的概念.

根据更具体的指标自动缩放

许多度量标准管道允许您按名称或一组称为标签的附加描述符来描述度量标准. 对于所有非资源度量标准类型(pod,对象和外部度量标准,如下所述),您可以指定一个附加的标签选择器,该选择器将传递到度量标准管道.

Autoscaling on more specific metrics

Many metrics pipelines allow you to describe metrics either by name or by a set of additional descriptors called labels. For all non-resource metric types (pod, object, and external, described below), you can specify an additional label selector which is passed to your metric pipeline.

例如,如果您使用动词 label 收集指标 http_requests ,则可以指定以下指标块以仅针对GET请求进行扩展:

For instance, if you collect a metric http_requests with the verb label, you can specify the following metric block to scale only on GET requests:

type: Object
object:
  metric:
    name: `http_requests`
    selector: `verb=GET`

此选择器使用与完整的Kubernetes标签选择器相同的语法. 如果名称和选择器匹配多个序列,则监视管道确定如何将多个序列折叠为单个值.

This selector uses the same syntax as the full Kubernetes label selectors. The monitoring pipeline determines how to collapse multiple series into a single value, if the name and selector match multiple series.

选择器是加性的,不能选择描述非目标对象的指标(对于Pods类型,则为目标容器;对于Object类型,则为所描述的对象).

The selector is additive, and cannot select metrics that describe objects that are not the target object (the target pods in the case of the Pods type, and the described object in the case of the Object type).

OpenShift中水平容器自动缩放器的自定义指标

这篇关于OpenShift中水平Pod自动缩放器的自定义指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆