autoscaling/v2
·HorizontalPodAutoscaler
HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.
Click on Property Name to show the description, and Pink Types to expand schema.
Required properties are marked with *
Change History
Kubernetes v1.32
3 properties have changed the description
- .spec.metrics.containerResource
- .spec.metrics.type
- .status.currentMetrics.type
Kubernetes v1.31
Kubernetes v1.30
Kubernetes v1.29
Kubernetes v1.28
Kubernetes v1.27
27 properties have changed the description
- .metadata.annotations
- .metadata.labels
- .metadata.name
- .metadata.namespace
- .metadata.ownerReferences.name
- .metadata.ownerReferences.uid
- .metadata.uid
- .spec.behavior.scaleDown.policies.periodSeconds
- .spec.behavior.scaleDown.policies.type
- .spec.behavior.scaleDown.policies.value
- .spec.behavior.scaleDown.stabilizationWindowSeconds
- .spec.behavior.scaleUp.policies.periodSeconds
- .spec.behavior.scaleUp.policies.type
- .spec.behavior.scaleUp.policies.value
- .spec.behavior.scaleUp.stabilizationWindowSeconds
- .spec.metrics.object.describedObject.apiVersion
- .spec.metrics.object.describedObject.kind
- .spec.metrics.object.describedObject.name
- .spec.scaleTargetRef.apiVersion
- .spec.scaleTargetRef.kind
- .spec.scaleTargetRef.name
- .status.currentMetrics.containerResource.container
- .status.currentMetrics.containerResource.name
- .status.currentMetrics.object.describedObject.apiVersion
- .status.currentMetrics.object.describedObject.kind
- .status.currentMetrics.object.describedObject.name
- .status.currentMetrics.resource.name
Kubernetes v1.26
3 properties have changed the description
- .spec.metrics.object.describedObject.kind
- .spec.scaleTargetRef.kind
- .status.currentMetrics.object.describedObject.kind
Kubernetes v1.25
1 property has been removed on this version
- .metadata.clusterName
Kubernetes v1.24
5 properties have changed the description
- .metadata.clusterName
- .metadata.generateName
- .metadata.managedFields.time
- .metadata.ownerReferences.blockOwnerDeletion
- .metadata.selfLink
Kubernetes v1.23
HorizontalPodAutoscaler was first seen on this version of Kubernetes
Kubernetes v1.22
Kubernetes v1.21
Kubernetes v1.20
Kubernetes v1.19
Kubernetes v1.18
Kubernetes v1.17
Kubernetes v1.16
Kubernetes v1.15
Kubernetes v1.14
Kubernetes v1.13
Kubernetes v1.12
Kubernetes v1.11
Examples
There are 2 examples of HorizontalPodAutoscaler that you can use as a starting point to create your own.
apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: my-app-hpa namespace: default # HorizontalPodAutoscaler is a namespaced resource spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: my-app-deployment minReplicas: 1 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 50
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: my-app-hpa
namespace: default # HorizontalPodAutoscaler is a namespaced resource
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: my-app-deployment
minReplicas: 1
maxReplicas: 4
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
- type: Resource
resource:
name: memory
target:
type: AverageValue
averageValue: 400Mi