Kubernetes Horizontal Pod Autoscaler: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 16: Line 16:
=HPA Manifest=
=HPA Manifest=
{{Internal|Kubernetes Horizontal Pod Autoscaler Manifest|Horizontal Pod Autoscaler Manifest}}
{{Internal|Kubernetes Horizontal Pod Autoscaler Manifest|Horizontal Pod Autoscaler Manifest}}
=Architecture=
=How it Works=
A HorizontalPodAutoscaler [[Kubernetes_API_Resources_Concepts#HorizontalPodAutoscaler|Kubernetes API resource]] enables and configures a horizontal pod controller. The controller periodically reads the appropriate [[Metrics_in_Kubernetes#Metrics|metrics API]], calculates the number of replicas required to meet the target metric value configured in the HorizontalPodAutoscaler resource, and adjust the "replicas" field on the target pod controller.
A HorizontalPodAutoscaler [[Kubernetes_API_Resources_Concepts#HorizontalPodAutoscaler|Kubernetes API resource]] enables and configures a horizontal pod controller. The controller periodically reads the appropriate [[Metrics_in_Kubernetes#Metrics|metrics API]], calculates the number of replicas required to meet the target metric value configured in the HorizontalPodAutoscaler resource, and adjust the "replicas" field on the target pod controller.


=Operations=
=Operations=
* [[Horizontal_Pod_Autoscaler_Operations#Create_an_Autoscaler|Create an autoscaler.]]
* [[Horizontal_Pod_Autoscaler_Operations#Create_an_Autoscaler|Create an autoscaler.]]

Revision as of 03:03, 7 October 2020

External

Internal

Overview

Horizontal pod autoscaling is the automatic increase or decrease the number of pod replicas managed by a higher level controller that supports scaling (deployments, replica sets, stateful sets).. The scaling is performed by a horizontal controller and it is controlled by a horizontal pod autoscaler Kubernetes API resource. For an horizontal pod autoscaler to work correctly, a source of metrics, in particular resource metrics, must be deployed. The simplest source of resource metrics is the metrics server.

Playground

https://github.com/ovidiuf/playground/tree/master/kubernetes/horizontal-pod-autoscaler

HPA Manifest

Horizontal Pod Autoscaler Manifest

How it Works

A HorizontalPodAutoscaler Kubernetes API resource enables and configures a horizontal pod controller. The controller periodically reads the appropriate metrics API, calculates the number of replicas required to meet the target metric value configured in the HorizontalPodAutoscaler resource, and adjust the "replicas" field on the target pod controller.

Operations