Links

Horizontal Pod Autoscaler

Reference for the humanitec/horizontal-pod-autoscaler driver
This generates a Horizontal Pod Autoscaler object.
Property
Description
Resource Type
Account Type
None

Inputs

Values

Name
Type
Description
annotations
map
Annotations to add to the manifest.
labels
map
Labels to add to the manifest.
maxReplicas
integer
The maximum number of replicas to scale to. (Must be > minReplicas.)
minReplicas
integer
The minimum number of replicas to scale to. (Must be > 0.)
targetCPUUtilizationPercentage
integer
The percentage of the CPU resource limit to attempt to scale to. (Must be between 0 and 100.)

Secrets

None

Notes

The driver will override any resource inputs provided if the driver inputs are more conservative. E.g. the final maxReplicas value will be min(resource_inputs.maxReplicas, driver_inputs.maxReplicas). If the values are omitted, the resource inputs are used.

Example

To create a resource definition that adds a Horizontal Pod Autoscaler to workloads that caps the maxReplicas at 2:
curl https://api.humanitec.io/orgs/${HUMANITEC_ORG}/resources/defs \
-X POST \
-H "Authorization: Bearer ${HUMANITEC_TOKEN}" \
-H "Content-Type: application/json" \
--data-binary '
{
"id": "hpa",
"name": "Horizontal Pod Autoscaler",
"type": "horizontal-pod-autoscaler",
"criteria": [
{
"env_type": "development"
}
],
"driver_type": "humanitec/horizontal-pod-autoscaler",
"driver_inputs": {
"values": {
"maxReplicas": 2
}
}
}'
Last modified 10mo ago