What is an HPA in Kubernetes?

Question
What is an HPA in Kubernetes?

Answer
HPA stands for HorizontalPodAutoscaler. It is a concept and resource that allows clusters to scale out upon a certain condition being met. HPA can support a pod to scale based on certain amounts of CPU utilization. It natively supports granular CPU requests down to a single millicore. A .yaml file in Kubernetes has the key "kind"; if you want to read more about these files, see this posting. The value associated with this "kind" definition can be "HorizontalPodAutoscaler".

The above was paraphrased from pages 443 and 447 of Kubernetes in Action by Luksa. (Pages 438 through 451 of Kubernetes in Action by Luksa have a fair amount on horizontal autoscaling of pods.)

Once Horizontal pod autocaling has been configured, the Horizontal controller scales pod replicas (ultimately based on metrics collected from cAdvisor). To learn more about the Horizontal controller, you can view these links:
https://github.com/kubernetes/kubernetes/blob/3a51aaf8b4baff1242ea30b08d599d913fe7a127/pkg/controller/podautoscaler/horizontal.go
https://www.magalix.com/blog/kubernetes-automatic-scaling
https://argoproj.github.io/argo-cd/roadmap/
https://programmer.group/source-code-analysis-of-kubernetes-hpa-controller.html

Leave a comment

Your email address will not be published. Required fields are marked *