# Horizontal Pod Autoscaler v1

This page describes the Kubernetes HPA v1 component type. The reference documentation for this HPA can be found [here](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/horizontal-pod-autoscaler-v1/).

## Metrics

| Name                    | Unit | Description                                                                                          |
| ----------------------- | ---- | ---------------------------------------------------------------------------------------------------- |
| k8s\_hpa\_min\_replicas | pods | The lower limit for the number of replicas to which the autoscaler can scale down.                   |
| k8s\_hpa\_max\_replicas | pods | The upper limit for the number of replicas to which the autoscaler can scale up.                     |
| k8s\_desired\_replicas  | pods | Desired number of replicas of pods managed by this autoscaler, as last calculated by the autoscaler. |
| k8s\_current\_replicas  | pods | Current number of replicas of pods managed by this autoscaler, as last seen by the autoscaler.       |

## Parameters

| Parameter                      | Type    | Unit       | Default                                   | Domain                             | Restart | Description                                                                                                                                                                                                                                                                                            |
| ------------------------------ | ------- | ---------- | ----------------------------------------- | ---------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| min\_replicas                  | integer | pods       | You should select your own default value. | You should select your own domain. | yes     | The lower limit for the number of replicas to which the autoscaler can scale down. min\_replicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available. |
| max\_replicas                  | integer | pods       | You should select your own default value. | You should select your own domain. | yes     | The upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that min\_replicas.                                                                                                                                                                                 |
| targetCPUUtilizationPercentage | integer | percentage | You should select your own default value. | 1 - 100                            | yes     | The target average CPU utilization (represented as a percentage of the requested CPU) over all the pods in the autoscaled deployment.                                                                                                                                                                  |

## Constraints

The following tables show a list of constraints that may be required in the definition of the study, depending on the tuned parameters:

| Formula                                                       | Notes                                        |
| ------------------------------------------------------------- | -------------------------------------------- |
| component\_name.min\_replicas < component\_name.max\_replicas | Min replicas must be lower than max replicas |
