In this lab, you will learn how to create an instance template and customize it to your needs, create a managed instance group that uses the instance template, and learn how to stress test your instances to make sure your configuration works!
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create an Instance Template
In the Google Cloud console, go to the Compute Engine and then go to Instance templates
Click Create instance template.
Name your Instance Template
Under Machine Type choose e2-micro
Under Firewall allow HTTP and HTTPS
Click Create
- Create a Managed Instance Group
For Health Check:
- In the Google Cloud console, go to the Health Check page.
- Click Create Health Check.
- Give the health check a name, Regional Scope, TCP protocol, port 80.
- Click Create.
For Creating the Instance Group:
- In the Google Cloud console, go to the Instance groups page.
- Click Create instance group.
- Under Instance template, select the instance template you created.
- Under Location, choose Single Zone US-Central1 for region, and US-Central1-A for zone.
- For Autoscaling, choose On: add and remove instances to the group with a min of 1 and a max of 3, and CPU Untilization at 60%.
- For Health Check, choose the health check you’ve created.
- Click Create.
- Test and Stress the Managed Instance Group
- Select the instance and choose SSH.
- Use command
sudo apt-get install stress
and thensudo stress --cpu 2 --timeout 500
to stress your instance. - After eight minutes, you should see your instance scale to maximum capacity of three instances.