<p>We are planning to Kubernetes horizontal pod scheduler and for that need to install Custom Metrics API.
Can someone please tell different ways to install Custom Metrics API on kubernetes cluster?</p>

<p>As you are using EKS with <a href="https://prometheus.io/" rel="nofollow noreferrer">Prometheus</a>, the best source of knowledge is AWS documentation.</p>
<blockquote>
<p>Do i need prometheus adaptor for registering custom metrics API?</p>
</blockquote>
<p>Yes, you need at least <code>Prometheus</code> and <a href="https://github.com/stefanprodan/eks-hpa-profile/blob/master/monitoring-system/prometheus-adapter.yaml" rel="nofollow noreferrer">Prometheus Adapter</a>.</p>
<ul>
<li><code>Prometheus:</code> scrapes pods and stores metrics</li>
<li><code>Prometheus metrics adapter:</code> queries <code>Prometheus</code> and exposes metrics for the Kubernetes custom metrics API</li>
<li><code>Metrics server:</code> collects pods CPU and memory usage and exposes metrics for the Kubernetes resource metrics API</li>
</ul>
<p>Without <code>Custom Metrics</code> or <code>External Metrics</code>, you can only use metrics based on <code>CPU</code> or <code>Memory</code>.</p>
<p>In <a href="https://aws.amazon.com/blogs/containers/autoscaling-amazon-eks-services-based-on-custom-prometheus-metrics-using-cloudwatch-container-insights/" rel="nofollow noreferrer">Autoscaling Amazon EKS services based on custom Prometheus metrics using CloudWatch Container Insights</a> article, it's stated:</p>
<blockquote>
<p>The custom metrics gathered by Prometheus can be exposed to the autoscaler using a <code>Prometheus Adapter</code> as outlined in the blog post titled <a href="https://aws.amazon.com/blogs/containers/autoscaling-eks-on-fargate-with-custom-metrics/" rel="nofollow noreferrer">Autoscaling EKS on Fargate with custom metrics</a>.</p>
</blockquote>
<p>In <code>Autoscaling EKS on Fargate with custom metrics</code> blog you also find some examples of <code>autoscaling based on CPU usage</code>, <code>autoscaling based on App Mesh traffic</code> or <code>autoscaling based on HTTP traffic </code></p>
<p><strong>Additional documentation</strong></p>
<ul>
<li><a href="https://docs.aws.amazon.com/eks/latest/userguide/prometheus.html" rel="nofollow noreferrer">Control plane metrics with Prometheus</a></li>
<li><a href="https://aws.amazon.com/premiumsupport/knowledge-center/eks-metrics-server/" rel="nofollow noreferrer">Why can't I collect metrics from containers, pods, or nodes using Metrics Server in Amazon EKS?</a></li>
<li><a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-Setup.html" rel="nofollow noreferrer">Install the CloudWatch agent with Prometheus metrics collection on Amazon EKS and Kubernetes clusters</a></li>
</ul>
