Kubernetes Horizontal Custom Metrics Autoscaling Walkthrough: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 2: Line 2:
* [[Kubernetes_Horizontal_Pod_Autoscaler#Custom_Metrics-based_Scaling|Kubernetes Horizontal Pod Autoscaler]]
* [[Kubernetes_Horizontal_Pod_Autoscaler#Custom_Metrics-based_Scaling|Kubernetes Horizontal Pod Autoscaler]]


=Overview=
=Process=
 
Install Prometheus as described here: {{Internal|Prometheus Installation with Helm|Prometheus Installation with Helm}}
 
Install Prometheus Pushgateway and configure it as a Prometheus target with a Prometheus Operator ServiceMonitor as described here: {{Internal|Prometheus_Pushgateway_Installation#Kubernetes_Installation|Prometheus Pushgateway Installation}}
 
Prometheus Pushgateway will be used to manually or programmatically publish custom metrics with a CLI script similar to [https://github.com/ovidiuf/playground/blob/master/prometheus/pushgateway/publish-metric publish-metric].
 
Install Prometheus Adapter for Kubernetes Metrics API as described here: {{Internal|Prometheus_Adapter_for_Kubernetes_Metrics_APIs#Helm_Installation|Prometheus Adapter for Kubernetes Metrics APIs Helm Installation}}
At the end of this step, custom metrics should be available at the [[Metrics_in_Kubernetes#Custom_Metrics_API|Custom Metric API]] endpoint and the Horizontal Pod Autoscaler should be able to use them in scaling decisions.
 
Deploy a Deployment and its v2beta2 Horizontal Pod Autoscaler. The Horizontal Pod Autoscaler manifest available here can be used as a template: {{Internal|Kubernetes_Horizontal_Pod_Autoscaler_Manifest_Version_2_beta_2|v2beta2 Kubernetes Horizontal Pod Autoscaler Manifest Example}}
Use a custom object metric similar to the one described here: {{Internal|Kubernetes_Horizontal_Pod_Autoscaler#Custom_Object_Metrics|Custom Object Metric Configuration Example}}

Latest revision as of 07:08, 16 October 2020

Internal

Process

Install Prometheus as described here:

Prometheus Installation with Helm

Install Prometheus Pushgateway and configure it as a Prometheus target with a Prometheus Operator ServiceMonitor as described here:

Prometheus Pushgateway Installation

Prometheus Pushgateway will be used to manually or programmatically publish custom metrics with a CLI script similar to publish-metric.

Install Prometheus Adapter for Kubernetes Metrics API as described here:

Prometheus Adapter for Kubernetes Metrics APIs Helm Installation

At the end of this step, custom metrics should be available at the Custom Metric API endpoint and the Horizontal Pod Autoscaler should be able to use them in scaling decisions.

Deploy a Deployment and its v2beta2 Horizontal Pod Autoscaler. The Horizontal Pod Autoscaler manifest available here can be used as a template:

v2beta2 Kubernetes Horizontal Pod Autoscaler Manifest Example

Use a custom object metric similar to the one described here:

Custom Object Metric Configuration Example