Diving into Kubernetes-1: Creating and Testing a Horizontal Pod Autoscaling (HPA) in Kubernetes Cluster

Let’s think, we have a constantly running production service with a load that is variable in time, where it is very busy during the day, and relatively low at night. Normally, we would want the number of nodes in the cluster and the number of pods in deployment to dynamically adjust to the load to meet end-user demand. The Cluster Autoscaling (CA) feature together with the Horizontal Pod Autoscaler (HPA) can handle this for you automatically. We will discuss them in detail in the articles by doing and testing them practically and step by step.

Cumhur Akkaya
11 min readOct 10, 2023

--

In this article, we will learn Kubernetes Autoscaling, I will explain the working logic of Horizontal Pod Autoscaler and Metric Server. We will do HPA in the Kubernetes Cluster consisting of a MangoDB Database, a Nodejs web application, and a PHP-Apache application. We will test whether our HPA is working by connecting to the K8s cluster. And we will see how the autoscaler reacts to increased load. For this, we will start a container, and send an infinite loop of queries to the php-apache service. In a different terminal in order to…

--

--

Cumhur Akkaya

✦ Multi-Cloud & DevOps Engineer, ✦Technical Writer, ✦AWS Community Builder, ✦LinkedInTop Voice, ✦Believes in learning by doing, ✦ linkedin.com/in/cumhurakkaya