GCP Managed Instance Groups (MIG) Overview
What you'll learn: How Google Cloud Platform uses Managed Instance Groups to deploy and manage collections of identical virtual machines automatically.
What is a Managed Instance Group?
A Managed Instance Group (MIG) is GCP's equivalent to AWS Auto Scaling Groups and Azure Virtual Machine Scale Sets. It's a collection of identical VM instances that GCP creates and manages as a single entity. Think of it like a cookie cutter: you define the template once, and GCP stamps out as many identical copies as you need.
Instance Templates: Your Blueprint
Before creating a MIG, you define an instance template — a blueprint that specifies machine type, boot disk image, network settings, and startup scripts. This template ensures every instance in your group is configured identically. You can't modify a template after creation; you create a new version instead.
Deployment Scope: Regional vs Zonal
MIGs come in two flavors:
Zonal MIG: All instances run in a single zone (e.g., us-central1-a). This is simpler but creates a single point of failure if that zone experiences issues.
Regional MIG: Instances spread across multiple zones within a region (e.g., across us-central1-a, us-central1-b, and us-central1-c). This provides higher availability — if one zone fails, instances in other zones keep running.
Regional MIGs automatically balance instances across zones, similar to cross-zone load balancing concepts you've learned.
Why Use MIGs?
MIGs handle the heavy lifting: automatic scaling based on metrics, automatic healing (replacing unhealthy instances), rolling updates, and seamless integration with GCP's load balancers. You define desired capacity and policies; GCP maintains that state.
Key Takeaway: MIGs use instance templates as blueprints to create identical VM collections, deployable either within a single zone (zonal) or distributed across multiple zones (regional) for better resilience.