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?
As you are using EKS with Prometheus, the best source of knowledge is AWS documentation.
Do i need prometheus adaptor for registering custom metrics API?
Yes, you need at least Prometheus
and Prometheus Adapter.
Prometheus:
scrapes pods and stores metricsPrometheus metrics adapter:
queries Prometheus
and exposes metrics for the Kubernetes custom metrics APIMetrics server:
collects pods CPU and memory usage and exposes metrics for the Kubernetes resource metrics APIWithout Custom Metrics
or External Metrics
, you can only use metrics based on CPU
or Memory
.
In Autoscaling Amazon EKS services based on custom Prometheus metrics using CloudWatch Container Insights article, it's stated:
The custom metrics gathered by Prometheus can be exposed to the autoscaler using a
Prometheus Adapter
as outlined in the blog post titled Autoscaling EKS on Fargate with custom metrics.
In Autoscaling EKS on Fargate with custom metrics
blog you also find some examples of autoscaling based on CPU usage
, autoscaling based on App Mesh traffic
or autoscaling based on HTTP traffic
Additional documentation