Resource Definitions
Driver
Capability
Flavor
Resource Type
Horizontal Pod Autoscaler
This section contains a Resource Definition example for handling Kubernetes
HorizontalPodAutoscaler
by using the
hpa
Driver. If you have special requirements for your HorizontalPodAutoscaler
implementation, you can
see this other example using the template
Driver
.
You can find a Score file example using the horizontal-pod-autoscaler
resource type
here
.
Resource Definitions #
hpa.yaml
(
view on GitHub
)
:
apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
id: hpa
entity:
driver_type: humanitec/hpa
name: hpa
type: horizontal-pod-autoscaler
driver_inputs:
values:
minReplicas: 2
maxReplicas: 5
targetCPUUtilizationPercentage: 80
criteria:
- {}
hpa.tf
(
view on GitHub
)
:
resource "humanitec_resource_definition" "hpa" {
driver_type = "humanitec/hpa"
id = "hpa"
name = "hpa"
type = "horizontal-pod-autoscaler"
driver_inputs = {
values_string = jsonencode({
"minReplicas" = 2
"maxReplicas" = 5
"targetCPUUtilizationPercentage" = 80
})
}
}
resource "humanitec_resource_definition_criteria" "hpa_criteria_0" {
resource_definition_id = resource.humanitec_resource_definition.hpa.id
}