Tutorial Highlights & Transcript
00:00 - Intro - EKS Managed Node Groups
00:32 - Scope of the Demo
01:20 - Workflow for Autoscaling Node Groups
01:37 - Steps and Commands
03:57 - Deploying the Kubernetes Cluster Autoscaler
That is all so, we have edited our deployment file for the auto-scaler. Once it is been done, after that, we will have to have the deployment, as well. We will mention that we need the replica set of only one replica set currently. In this, we have also mentioned that these pods have a one CPU of one core as well as the one gig of memory, as well. But yes, the main difference which has been created, we just have to mention which nodes that we have to use and which capacity of node types we have to use. This is the line that we need to edit so, that is being already created here, you can see that file has already been made. And we just have to now apply this deployment to our cluster. It is being deployed and now we can get the details that they’ve got all the resources we have in our cluster.
You can see a deployment is being created and the replica set as well as the code is running. Now just to confirm our auto-scaling has been working properly with the node groups so we are just going to scale up our replica sets to six to one from one to six so that it can put the loads on the node group and then we can see from loads of our Kubernetes auto-scaler so that we can see that it has commanded to the node group that we have to scale from one to six and as per the requirements. With this one, we can check the loads, as well. It will take some time, as well. Here, we can check.
Yes, you can see here it has commanded that the nodes should be from one to six that it has scaled in an open one. So this will take some time to be running in a steady-state and we can also check again all the resources. We can see that currently, the pod will be in a pending state because of the less amount of code that can be issued on the nodes. Yeah, it will take some time.
In the meantime, we can check on AWS, as well. This is our EKS cluster and there are two types of node groups currently, two nodes are running. One is having the capacity of on-demand and the other is spot instances. Let me refresh it if some of the nodes have been spinning up. You can see now we have three nodes as the load has been increased. We have three nodes. It will spin up to more nodes, as well. You can see now we have five nodes. This way, we have seen how we can auto-scale our node groups so that we can meet the requirement of having the proper nodes. It is done.
08:25 - Horizontal Auto-Scaling for Pods
Yes, for that also I have some of the commands and the steps that I will have to perform. But yes, the auto-scaler only works once it will have the Kubernetes metric server with this because it will take all the resource utilization from the Kubernetes metrics of the pod only. So with this command, we can deploy the metrics server as well or on our cluster. And after that. Yeah, so after that, again, we have to create a dummy deployment where we will see how we can put a load on the deployment and it will auto-scale the pod or you can see the replica set on the pod deployment. And not only this, if you again want to do all the pods on the node which has the capacity type of spot, we just need to add these lines on these two nodes under our deployment so we can add those lines, as well. It’s been done.
10:54 - Checking Resources Post-Deployment
Let me describe the code, as well. You can see it is running on the node having the IP address. It needs to be two to eleven.
Check again. As you can see, here is the node of type spot instances. Now, let’s again check if HPA has been ready or not.
Yes, you can see here it is showing zero percent because there is no load currently in our deployment. Let me put the load using those commands. This is the dummy load that we have. Load is now starting to increase. We will see the same on the other dummy node the load has been increasing and it will start to increase the replica set according to the load. Currently, this is zero and currently, you can see only one replica set is running and once the load is going up and above the 50% it will start to increase the replica set as well over deploying. We just have to wait for some time. You can see, that the load is now up. It is 133%. Now it will start to increase the replica set.
You can see now the replica set has three and it will scale up to 10. It will have to be 50% or below the 50% until it will be scaling over replica set up to 10 only as we have delivered. So this is all for my demo that we have seen that how we have like enabled the auto-scaling on node groups as well as on our post-deployment.
Rishav Bagga
Support Team Lead
nClouds
Rishav is a Support Team Lead at nClouds. He has a Bachelor of Technology Engineering degree from the Rayat & Bahra Institute of Engineering & Nano Technology. Rishav has achieved AWS certifications as a Cloud Practitioner, Solutions Architect (Associate), SysOps Administrator (Associate), and is a Datadog Certified Technical Specialist.