---
source: https://iinventedlight.com/library/notes/kubernetes-horizontal-pod-autoscaling.md
title: "Kubernetes Horizontal Pod Autoscaling"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC BY 4.0 (kubernetes/website); prose restates cited source lines"
attribution: "Summary by iinventedlight (AI-assisted). Sources: Kubernetes Authors, Horizontal Pod Autoscaling, CC BY 4.0 (kubernetes/website); Kubernetes Authors, HorizontalPodAutoscaler Walkthrough, CC BY 4.0 (kubernetes/website)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-ai-eng: Kubernetes"
tags: ['kubernetes', 'autoscaling', 'hpa', 'scaling']
sources:
  - id: S1
    title: "Horizontal Pod Autoscaling"
    publisher: Kubernetes Authors
    url: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
    accessed: 2026-11-04
    license: "CC BY 4.0 (kubernetes/website)"
  - id: S2
    title: "HorizontalPodAutoscaler Walkthrough"
    publisher: Kubernetes Authors
    url: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/
    accessed: 2026-11-04
    license: "CC BY 4.0 (kubernetes/website)"
---
# Kubernetes Horizontal Pod Autoscaling

**Answer:** 

## Quick start

```bash
kubectl autoscale deployment php-apache --cpu=50% --min=1 --max=10
kubectl get hpa --watch
```

## Declarative

```yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata: {name: php-apache}
spec:
  scaleTargetRef: {apiVersion: apps/v1, kind: Deployment, name: php-apache}
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Resource
    resource: {name: cpu, target: {type: Utilization, averageUtilization: 50}}
```

## Requirements

- Install Metrics Server separately.
- Set CPU requests on containers; utilization is a percentage of the request.

## Horizontal vs vertical

Horizontal scaling adds Pods; vertical scaling gives existing Pods more CPU or memory.

## Claims
- id: C1
  claim: A HorizontalPodAutoscaler automatically updates a workload resource.
  source: S1
  evidence: "In Kubernetes, a HorizontalPodAutoscaler automatically updates a workload resource (such as"
- id: C2
  claim: Horizontal scaling responds to load by deploying more Pods.
  source: S1
  evidence: "Horizontal scaling means that the response to increased load is to deploy more"
- id: C3
  claim: Metrics usually come from Metrics Server, launched separately.
  source: S1
  evidence: "usually provided by an add-on named Metrics Server, which needs to be launched separately."
- id: C4
  claim: kubectl autoscale can create an HPA.
  source: S2
  evidence: "kubectl autoscale deployment php-apache --cpu=50% --min=1 --max=10"

## Sources
- [S1] Horizontal Pod Autoscaling. Kubernetes Authors. https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ . License: CC BY 4.0 (kubernetes/website). Accessed 2026-11-04.
- [S2] HorizontalPodAutoscaler Walkthrough. Kubernetes Authors. https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/ . License: CC BY 4.0 (kubernetes/website). Accessed 2026-11-04.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
