Google Instance group with Instance Template

Google Instance group with Instance Template

ยท

2 min read

Today we will launch instance using instance template and instance Group

Without Instance Template we can't launch Instance Group, So we will first create instance Template.

Step 1:- Expand services, Go to compute Engine and click on Instance Template.

image.png

Step 2:- Click on create Instance Template.

image.png

Step 3:- Name your instance template and choose your Machine type.

image.png

Step 4:- Scroll down Under firewall Allow HTTP traffic and Allow HTTPS traffic.

image.png

Step 5:- Expand Advanced Options under that click on Management and paste your script under startup script, Finally click on create.

#!/bin/bash
apt update 
apt -y install apache2
echo "Hello world from $(hostname) $(hostname -I)" > /var/www/html/index.html

chrome_eHzWwrItaR.gif image.png

Step 6:- Your Instance template is ready.

image.png

Step 7:- On your left Scroll down and click on instance groups.

image.png

Step 8:- Click on create instance groups. image.png

Step 9:- Choose New managed instance group (stateless).

image.png

Step 10:- Give a name for your instance group and choose your instance template.

image.png

Step 11:- Under location choose Multiple zone and Target distribution shape as Even.

Even here means Your Traffic will be distributed evenly to your instance.

image.png

Step 12:- Under Autoscaling, We are going to need Minimum number of instances as 2 for now and Maximum number of instances as 4.

image.png

Step 13:- Click on CPU utilization: 60% (default).

image.png

Step 14:- Metric Type will be CPU Utilization, Target CPU utilization as 75 and finally click done.

image.png

Step 15:- Click to create Instance group.

image.png

Step 16:- As you can see we got our two instance because we mentioned minimum 2 instance, Which will always runs if something happens to our instance, Instance group will make sure you will get your 2 instance up and running always.

Now if you copy, paste your External IP address it should work.

image.png

image.png

image.png

That's it, for now, we will continue further more in next blog.

Hope you liked it. Will see you on the next topic ๐Ÿ˜ƒ

Next Topic

bvakash.hashnode.dev/google-load-balancer-g..

ย