kubernetes GKE中的外部度量,rabbimq队列长度不起作用,给出错误

0tdrvxhp  于 5个月前  发布在  Kubernetes
关注(0)|答案(1)|浏览(71)

我试图在GKE中使用基于外部指标的HPA,但它给出错误-horizontal-pod-autoscaler unable to get external metric default/custom.googleapis.com|rabbitmq_queue_messages_ready/nil: unable to fetch metrics from external metrics API: the server is currently unable to handle the request (get custom.googleapis.com|rabbitmq_queue_messages_ready.external.metrics.k8s.io
我已经在k8集群中设置了一个外部指标,该指标将数据发送到google stackdriver。此指标包含有关rabbitmq中消息数量的信息,此队列在集群外。基于队列长度,我正在尝试自动缩放我的pod。现在我可以将数据推送到stackdriver,并且可以在Metric Explorer中查看指标。但是当我尝试在HPA中使用此指标时,它会出错。
HPA -

apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: exp-anno-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1beta1
    kind: Deployment
    name: exp-anno
  minReplicas: 2
  maxReplicas: 6
  metrics:
  - type: External
    external:
      metricName: "custom.googleapis.com|rabbitmq_queue_messages_ready"
      targetValue: 10

字符串

相关问题