Instance templates
Before we can create an MIG, we need to define an instance template. Instance templates define a Compute Engine instance prototype with attributes such as its image and machine type. When creating a managed instance group, Compute Engine refers to the instance template to generate the VMs.
Our instance template will create a simple HTTP server serving traffic on port 80. If this is the first VM to do so in your project, you'll first need to create a firewall rule to allow HTTP traffic on that port. We'll be taking a closer look at this in the networking chapter but to create the firewall rule now, execute the script included in this book's source code under chapter_07/example_01/00-create-http-firewall-rule.sh.
With the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access