Prometheus Metrics - Use for autoscaling

9/10/2018

I've setup prometheus to collect metrics from my pods and nodes. I've also setup the prometheus custom metrics adapter.

How can I use those metrics provided by prometheus to autoscale my pods ? I tried to google it but I only find custom pods that provides their metrics on their /metrics url. I would like to be able to autoscale any of my pods that already have a prometheus metric based on the cpu or memory usage.

I can visualize all the metrics in grafana for all my pods and nodes but can't find a way to use it with autoscale

-- Ben D
kubernetes
prometheus

1 Answer

9/10/2018

You need to create an HPA (Horizontal Pod Autoscaler)

More info here

This is a good tool showing you how to use an HPA with custom metrics either using a the K8s metrics server or Prometheus.

-- Rico
Source: StackOverflow