Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes 基于GPU利用率的GKE水平Pods自动缩放(HPA)_Kubernetes_Google Compute Engine_Google Kubernetes Engine_Kubernetes Pod_Hpa - Fatal编程技术网

Kubernetes 基于GPU利用率的GKE水平Pods自动缩放(HPA)

Kubernetes 基于GPU利用率的GKE水平Pods自动缩放(HPA),kubernetes,google-compute-engine,google-kubernetes-engine,kubernetes-pod,hpa,Kubernetes,Google Compute Engine,Google Kubernetes Engine,Kubernetes Pod,Hpa,我试图在基于GPU利用率的GCP中实现水平Pods自动缩放(HPA)。 我的hpa.yaml文件如下所示: kind: HorizontalPodAutoscaler metadata: name: my-hpa spec: minReplicas: 1 maxReplicas: 10 metrics: - type: External external: metricName: kubernetes.io|container|accelerator|dut

我试图在基于GPU利用率的GCP中实现水平Pods自动缩放(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上,它表示无法读取所有指标

在堆栈驱动程序监控中,我创建了一个具有上述指标的仪表板


有人遇到过这个问题吗

在评论中总结我们的谈话:


为了在kubernetes中使用GCP度量,必须部署。这就是为什么HPA无法读取指标,因此抛出错误。

尝试使用
compute.googleapis.com | container | accelerator | duty | cycle
这似乎也不起作用。。我收到同样的错误,请确保您正确部署并且它正在运行。我刚刚用hpa和GPU创建了一个gke集群,所有这些似乎都在为我工作。谢谢。。它现在似乎起作用了。我只需要计算出有效的targetAverageValue。你通常设定什么?现在我知道,当我运行kubectl Descripte hpa
Warning FailedComputeMetricsReplicates 43m水平吊舱自动缩放器无法获取kubernetes.io |容器|加速器|占空比外部度量:无法获取外部度量默认值/kubernete s.io |容器|加速器|占空比/&标签选择器{matchLabelLabelLabelLabelLabels:map[string]字符串{,MatchExpressions:[],}:无法从外部度量API获取度量:服务器当前无法处理请求(get kubernetes.io | container | accelerator | duty | cycle.external.metrics.k8s.io)