<p>I am trying to achieve Horizontal Pods Autoscaling (HPA) in GCP based on GPU utilization.
My hpa.yaml file looks like this:</p>

<pre><code>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
</code></pre>

<p>After I run <code>kubectl create -f hpa.yaml</code> , I see the following error in the GCP.</p>

<p><a href="https://i.stack.imgur.com/bgQPT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bgQPT.png" alt="enter image description here"></a> </p>

<p>On the HPA, it says unable to read all metrics.</p>

<p>In stack driver monitoring I have created a dashboard with the metric mentioned above.</p>

<p>Has anyone come across this issue? </p>

<p>Summarizing our conversation in comments:</p>

<p>To make use of GCP metrics in kubernetes, <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/external-metrics-autoscaling#step1" rel="nofollow noreferrer">Custom Metrics Stackdriver Adapter</a> had to be deployed. This is why HPA was unable to read the metrics and therefore was throwing errors.</p>
