<p><a href="https://i.stack.imgur.com/sjgU9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sjgU9.png" alt="enter image description here" /></a></p>
<p>I want to use the pod network received bytes count standard kubernetes metrics on HPA . Using following yaml to accomplish that but getting errors like unable to fetch metrics from custom metrics API: no custom metrics API (custom.metrics.k8s.io) registered</p>
<pre><code>apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: xxxx-hoa
  namespace: xxxxx
spec:
  scaleTargetRef:
    apiVersion: apps/v1beta1
    kind: Deployment
    name: xxxx-xxx
  minReplicas: 2
  maxReplicas: 6
  metrics:
  - type: Pods
    pods:
      metricName: received_bytes_count
      targetAverageValue: 20k
</code></pre>
<p>If anybody had an experience with same kind of metrics usage that would be greatly helpful</p>
<p><a href="https://i.stack.imgur.com/kLrx5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kLrx5.png" alt="enter image description here" /></a></p>

<p>autoscaling/v1 is an API in order to autoscale based only on CPU utilization. So, in order to autoscale based on other metrics you should use autoscaling/v2beta2. I recommend you to read this <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/horizontal-pod-autoscaling#api-versions" rel="nofollow noreferrer">doc</a> to check API versions.</p>
