
What we will cover,
- Overview of Application Scaling in Azure Kubernetes Service
- Implement the Scaling of Guestbook Application
- Scale Frontend components of Guestbook Application
Prerequisites
- Article: Application Deployment on AKS | Part – 1
- Article: Application Deployment on AKS | Part – 2
- Article: Application Deployment on AKS | Part – 3
Overview of Application Scaling in Azure Kubernetes Service
When you are running an application, it requires scaling and upgrading which is a very critical stage for an application. The application consists of frontend and backend; scaling is required to handle additional loads within the application. Upgrading is required to keep your application up to date and to be able to introduce new functionality. The main advantage of using cloud-native applications is the Scaling which is in demand. It optimizes the application, for example, as I mentioned above the application has two parts, one is front-end and another one is Backend. If the frontend components encounter heavy loads you can only scale the frontend alone and your backend instances are the same. You can increase or reduce the number/size of Virtual Machines (VM) required depending on your workload and peak demand hours.
There are two scale dimensions for applications running on top of Azure Kubernetes Service. The first scale dimension is the number of Pods a deployment has, while the second scale dimension in Azure Kubernetes Service AKS is the number of nodes in the cluster.
By adding additional Pods to a deployment, also known as scaling out, you add additional compute power to the deployed application. You can either scale out your applications manually or have Kubernetes take care of this automatically via the Horizontal Pod Autoscaler (HPA). The HPA will watch metrics such as CPU to determine whether Pods need to be added to your deployment.
The second scale dimension in AKS is the number of nodes in the cluster. The number of nodes in a cluster defines how much CPU and memory are available for all the applications running on that cluster. You can scale your cluster either manually by changing the number of nodes, or you can use the cluster autoscaler to automatically scale out your cluster. The cluster autoscaler will watch the cluster for Pods that cannot be scheduled due to resource constraints. If Pods cannot be scheduled, it will add nodes to the cluster to ensure that your applications can run.
In this article, you will learn how you can scale your application. First, you will scale your application manually, and in the second part, you will scale your application automatically.
Implementing the scaling of Guestbook Application
To demonstrate manual scaling, let's use the guestbook example that we used in the previous articles. Follow these steps to learn how to implement manual scaling,
- Open your friendly Cloud Shell, as highlighted
- Clone the GitHub repository following command all the files I have placed there,
- git clone https://github.com/RumeelHussain/Azure-K8s
- cd Azure-K8s/Scale-Upgrade/
- Install the guestbook by running the kubectl create command in the Azure command line,
- kubectl create -f guestbook-all-in-one.yaml
- After you have entered the preceding command, you should see something similar, as shown in the screenshot:
- Right now, none of the services are publicly accessible. We can verify this by running the following command,
- kubectl get svc
- In the mentioned screenshot none of the services have an external IP,









Join the conversation! Your thoughts help the community grow.