<p>I'am trying to set up the metrics to activate HPA (Horizontal Pod Auto-scaling)
I follow <a href="https://rancher.com/blog/2018/2018-08-06-k8s-hpa-resource-custom-metrics/" rel="nofollow noreferrer">this tutorial</a> only the <strong>Custom Metrics (Prometheus)</strong> .</p>

<p>Unfortunately when i execute the command  below :</p>

<pre><code>  kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1
{"kind":"APIResourceList","apiVersion":"v1","groupVersion":"custom.metrics.k8s.io/v1beta1","resources":[]}  
</code></pre>

<p>I must to see a lot of thing on <strong>resources</strong> however there is nothing. </p>

morla
<p>This might be the issue how you setup metrics-server and metrics-server could not able to find your resources on InternalIP.</p>

<p>The solution is to replace the <code>metrics-server-deployment.yaml</code> file in <code>metrics-server/deploy/1.8+</code> with the following yaml file:</p>

<pre><code>apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: metrics-server
   namespace: kube-system
 ---
 apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
   name: metrics-server
   namespace: kube-system
   labels:
     k8s-app: metrics-server
 spec:
   selector:
     matchLabels:
       k8s-app: metrics-server
   template:
     metadata:
       name: metrics-server
       labels:
         k8s-app: metrics-server
     spec:
       serviceAccountName: metrics-server
       volumes:
       # mount in tmp so we can safely use from-scratch images and/or read-only containers
       - name: tmp-dir
         emptyDir: {}
       containers:
       - command:
         - /metrics-server
         - --metric-resolution=30s
         - --kubelet-insecure-tls
         - --kubelet-preferred-address-types=InternalIP
         name: metrics-server
         image: k8s.gcr.io/metrics-server-amd64:v0.3.1
         imagePullPolicy: Always
         volumeMounts:
         - name: tmp-dir
           mountPath: /tmp
</code></pre>

<p>Also, enable the <code>--authentication-token-webhook</code> in <code>kubelet.conf</code>, then you will be able to get the metrics.</p>

<p>Also, checkout my answer for step by step instruction to set the HPA using metrics-server.</p>

<blockquote>
  <p><a href="https://stackoverflow.com/questions/53725248/how-to-enable-kubeapi-server-for-hpa-autoscaling-metrics/53727101#53727101">How to Enable KubeAPI server for HPA Autoscaling Metrics</a></p>
</blockquote>

<p>Hope this helps. Revert back if you face any issues. </p>
