0
0
GCPcloud~30 mins

Managed instance groups in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Create a Managed Instance Group on Google Cloud
📖 Scenario: You are setting up a scalable web application on Google Cloud. To handle traffic efficiently, you want to create a group of virtual machines that can automatically grow or shrink based on demand.
🎯 Goal: Build a Managed Instance Group (MIG) using Google Cloud CLI commands that launches multiple instances from a template and can scale automatically.
📋 What You'll Learn
Create an instance template named web-template with a Debian image
Create a managed instance group named web-mig in the us-central1-a zone using the web-template
Set the initial size of the managed instance group to 2 instances
Configure autoscaling for the managed instance group to scale between 2 and 5 instances based on CPU utilization at 60%
💡 Why This Matters
🌍 Real World
Managed instance groups help run applications that need to handle changing traffic by automatically adding or removing virtual machines.
💼 Career
Cloud engineers and DevOps professionals use managed instance groups to ensure applications are scalable, reliable, and cost-efficient.
Progress0 / 4 steps
1
Create an instance template
Use the gcloud command to create an instance template named web-template with the Debian 11 image.
GCP
Need a hint?

Use gcloud compute instance-templates create with --image-family=debian-11 and --image-project=debian-cloud.

2
Create a managed instance group
Create a managed instance group named web-mig in the us-central1-a zone using the instance template web-template and set the size to 2.
GCP
Need a hint?

Use gcloud compute instance-groups managed create with --size 2, --template web-template, and --zone us-central1-a.

3
Configure autoscaling for the managed instance group
Set autoscaling on the managed instance group web-mig in us-central1-a to scale between 2 and 5 instances based on CPU utilization at 60%.
GCP
Need a hint?

Use gcloud compute instance-groups managed set-autoscaling with the correct flags for min, max replicas and CPU utilization.

4
Verify the managed instance group configuration
Add the command to describe the managed instance group web-mig in us-central1-a to check its configuration.
GCP
Need a hint?

Use gcloud compute instance-groups managed describe with the group name and zone.