Kubespec Logo kubespec.dev

autoscaling/v2

Namespaced Resource

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

Kubernetes v1.31

Kubernetes v1.30

Kubernetes v1.29

Kubernetes v1.28

Kubernetes v1.27

~27

Kubernetes v1.26

~3

Kubernetes v1.25

-1

Kubernetes v1.24

~5

Kubernetes v1.23

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

Other useful resources