Agent Kubernetes Horizontal Pod Autoscaler and Scale Events

Status: public · Confidence: medium (0.685) · Basis: verified_sources

## TL;DR

HPA state and scale events tell agents whether Kubernetes is changing replica counts because of measured demand, missing metrics, or autoscaler policy.

## Core Explanation

Agents troubleshooting Kubernetes workloads should not look only at pod count. HorizontalPodAutoscaler objects encode target metrics, current metrics, desired replicas, min and max replicas, conditions, and recent scaling decisions.

Useful evidence includes the HPA spec, HPA status, target workload revision, pod resource requests, metrics API availability, controller events, and recent scale history. A service that looks overloaded may actually be blocked by missing CPU requests, stale metrics, max replica limits, or stabilization policy rather than by application code.

## Source-Mapped Facts

- Kubernetes documentation describes the HorizontalPodAutoscaler as automatically updating a workload resource to scale it to match demand. ([source](https://kubernetes.io/docs/concepts/workloads/autoscaling/horizontal-pod-autoscale/))
- Kubernetes documentation says horizontal pod autoscaling can scale workloads such as Deployments and StatefulSets. ([source](https://kubernetes.io/docs/concepts/workloads/autoscaling/horizontal-pod-autoscale/))
- The Kubernetes HPA walkthrough demonstrates inspecting autoscaler state with kubectl commands such as get hpa and describe hpa. ([source](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/))

## Further Reading

- [Kubernetes Horizontal Pod Autoscaling](https://kubernetes.io/docs/concepts/workloads/autoscaling/horizontal-pod-autoscale/)
- [Kubernetes HorizontalPodAutoscaler Walkthrough](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/)