我正在尝试基于GPU利用率在GCP中实现水平窗格自动缩放(HPA)。 我的hpa.yaml文件如下所示:
kind: HorizontalPodAutoscaler
metadata:
name: my-hpa
spec:
minReplicas: 1
maxReplicas: 10
metrics:
- type: External
external:
metricName: kubernetes.io|container|accelerator|duty_cycle
targetAverageValue: 10
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: my-container-worker
运行kubectl create -f hpa.yaml
后,我在GCP中看到以下错误。
在HPA上,它说无法读取所有指标。
在堆栈驱动程序监视中,我使用上述指标创建了一个仪表板。
有人遇到这个问题吗?
答案 0 :(得分:0)
在评论中总结我们的对话:
要在kubernetes中使用GCP指标,必须部署Custom Metrics Stackdriver Adapter。这就是HPA无法读取指标并因此引发错误的原因。