Google Kubernetes引擎(GKE)上的水平吊舱自动缩放器(HPA),通过Stackdriver外部度量使用入口负载平衡器的后端延迟

Google Kubernetes引擎(GKE)上的水平吊舱自动缩放器(HPA),通过Stackdriver外部度量使用入口负载平衡器的后端延迟,kubernetes,google-cloud-platform,google-kubernetes-engine,Kubernetes,Google Cloud Platform,Google Kubernetes Engine,我正试图在GoogleKubernetes引擎(GKE)上配置一个水平吊舱自动缩放器(HPA),该引擎使用来自入口负载平衡器的外部指标,配置基于以下指令 和 以HPA为例 apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: my-api namespace: production spec: minReplicas: 1 maxReplicas: 20 metrics:

我正试图在GoogleKubernetes引擎(GKE)上配置一个水平吊舱自动缩放器(HPA),该引擎使用来自入口负载平衡器的外部指标,配置基于以下指令

以HPA为例

apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: my-api
  namespace: production
spec:
  minReplicas: 1
  maxReplicas: 20
  metrics:
  - external:
      metricName: loadbalancing.googleapis.com|https|request_count
      metricSelector:
        matchLabels:
          resource.labels.forwarding_rule_name: k8s-fws-production-lb-my-api--63e2a8ddaae70
      targetAverageValue: "1"
    type: External
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-api

当请求计数上升时,autoscaler会启动,但在服务上施加重负载(如每秒100个同时请求)不会使外部度量值
请求计数
远远超过6 rpm,而Stackdriver中观察到的
后端延迟
度量值会显著增加;因此,我想通过添加到HPA配置中来利用该指标,如下所示:

  - external:
      metricName: loadbalancing.googleapis.com|https|backend_latencies
      metricSelector:
        matchLabels:
          resource.labels.forwarding_rule_name: k8s-fws-production-lb-my-api--63e2a8ddaae70
      targetValue: "3000"
    type: External
但这会导致错误:

…无法从外部度量API获取度量:googleapi:错误400:字段聚合。perSeriesAligner的“ALIGN_RATE”值无效:无法将对齐器应用于具有种类增量和值类型分布的度量,badRequest

这可以通过命令观察到

$ kubectl describe hpa -n production
或者通过访问

使用设置代理后

$ kubectl proxy --port=8080

在GKE的HPA配置中,
https/backend\u延迟是否作为外部Stackdriver指标受支持?

这里运气好吗??我也面临着类似的问题