concept

Horizontal autoscaling

Learn Kubernetes HPA v2 metrics, replica calculations, stabilization, scaling policies and safe capacity limits.

Formal Syntax & Structure

kubernetes syntaxkubernetes
Horizontal autoscaling

Working Example

Example Snippetkubernetes
apiVersion: autoscaling/v2kind: HorizontalPodAutoscalermetadata:  name: catalog  namespace: scaling-studyspec:  scaleTargetRef:    apiVersion: apps/v1    kind: Deployment    name: catalog  minReplicas: 2  maxReplicas: 8  metrics:  - type: Resource    resource:      name: cpu      target:        type: Utilization        averageUtilization: 50  behavior:    scaleDown:      stabilizationWindowSeconds: 300      policies:      - type: Pods        value: 1        periodSeconds: 60
Kubernetes Reference