Creating a Managed Instance Group of Web Servers & Configuring Auto-Scaling
- To creating the instance template go to your Compute Engine dashboard and then click on Instance Templates and then click on Create instance template
- You need to enter the instance template name and then you will need to select the Machine type, for machine type you can select e2-small
- Then in Boot Disk section click on change boot disk and select Custom images and select the image which you created
- Make sure that you allow HTTP traffic since we are creating an instance template for a web server
then finally you click on Create
- next is to create instance group so go to Instance groups section and click on Create instance group
- You need to enter the name of the instance group and select instance template which we just created in above steps
This instance group would be creating instances in zone, so you will be selecting multiple zone
- In this section you can basically define the autoscaling criteria so minimum you will say that you want 2 instances and during the CPU utilization or the auto scaling metric is met then in that scenario maximum 4 instances can be created
And finally here also you Create
- This instance group will create two instances for you
- Login to both the instances by clicking on the SSH button and then installed stress and run stress
sudo yum install -y epel-release sudo yum install -y stress stress -c 70
- Stress will generate a CPU utilization of 70% on both instances and this shall trigger the auto scaling then additional instances would be created
Tag:Google Cloud