
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Configure HTTP and health check firewall rules
/ 40
Configure instance templates and create instance groups
/ 30
Configure the Internal Load Balancer
/ 30
Google Cloud offers Internal Load Balancing for your TCP/UDP-based traffic. Internal Load Balancing enables you to run and scale your services behind a private load balancing IP address that is accessible only to your internal virtual machine instances.
In this lab you create two managed instance groups in the same region. Then, you configure and test an Internal Load Balancer with the instances groups as the backends, as shown in this network diagram:
In this lab you learn how to perform the following tasks:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Configure firewall rules to allow HTTP traffic to the backends and TCP traffic from the Google Cloud health checker.
The network my-internal-app
with subnet-a and subnet-b along with firewall rules for RDP, SSH, and ICMP traffic have been configured for you.
In the console, navigate to Navigation menu > VPC network > VPC networks.
Scroll down and notice the my-internal-app network with its subnets: subnet-a and subnet-b
Each Google Cloud project starts with the default network. In addition, the my-internal-app network has been created for you, as part of your network diagram.
You will create the managed instance groups in subnet-a and subnet-b. Both subnets are in the
Create a firewall rule to allow HTTP traffic to the backends from the Load Balancer and the internet (to install Apache on the backends).
Still in VPC network, in the left pane click Firewall.
Notice the app-allow-icmp and app-allow-ssh-rdp firewall rules.
These firewall rules have been created for you.
Click + Create Firewall Rule.
Set the following values, leave all other values at their defaults:
Property | Value (type value or select option as specified) |
---|---|
Name | app-allow-http |
Network | my-internal-app |
Targets | Specified target tags |
Target tags | lb-backend |
Source filter | IPv4 Ranges |
Source IPv4 ranges | 10.10.0.0/16 |
Protocols and ports | Specified protocols and ports, and then check tcp, type: 80 |
Health checks determine which instances of a Load Balancer can receive new connections. For Internal load balancing, the health check probes to your load balanced instances come from addresses in the ranges 130.211.0.0/22
and 35.191.0.0/16
. Your firewall rules must allow these connections.
Still in the Firewall rules page, click + Create Firewall Rule.
Set the following values, leave all other values at their defaults:
Property | Value (type value or select option as specified) |
---|---|
Name | app-allow-health-check |
Network | my-internal-app |
Targets | Specified target tags |
Target tags | lb-backend |
Source filter | IPv4 Ranges |
Source IPv4 ranges | 130.211.0.0/22 and 35.191.0.0/16 |
Protocols and ports | Specified protocols and ports, and then check tcp |
Click Check my progress to verify the objective.
A managed instance group uses an instance template to create a group of identical instances. Use these to create the backends of the Internal Load Balancer.
An instance template is an API resource that you can use to create VM instances and managed instance groups. Instance templates define the machine type, boot disk image, subnet, labels, and other instance properties. Create an instance template for both subnets of the my-internal-app network.
In the Console, navigate to Navigation menu > Compute Engine > Instance templates.
Click Create instance template.
For Name, type instance-template-1.
For Location, Select Global.
For Series, select E2.
For Machine type, select Shared-core > e2-micro.
Click Advanced options.
Click Networking.
For Network tags, specify lb-backend.
For Network interfaces, click the dropdown icon to edit.
Set the following values, leave all other values at their defaults:
Property | Value (type value or select option as specified) |
---|---|
Network | my-internal-app |
Subnetwork | subnet-a |
External IPv4 Address | None |
Click Done.
Click Management.
Under Metadata, click Add item and specify the following:
Key 1 | Value 1 |
---|---|
startup-script-url | gs://cloud-training/gcpnet/ilb/startup.sh |
Create another instance template for subnet-b by copying instance-template-1:
Create a managed instance group in subnet-a and one subnet-b.
us-west2-a
, you could select us-west2-b
for subnet-b.
Still in Compute Engine, in the left pane click Instance groups, and then click Create Instance group.
Set the following values, leave all other values at their defaults:
Property | Value (type value or select option as specified) |
---|---|
Name | instance-group-1 |
Instance template | instance-template-1 |
Location | Single-zone |
Region | |
Zone | |
Autoscaling > Minimum number of instances | 1 |
Autoscaling > Maximum number of instances | 5 |
Autoscaling > Autoscaling signals (click the dropdown icon to edit) > Signal type | CPU utilization |
Target CPU utilization | 80 |
Initialization period | 45 |
Click Create.
Repeat the same procedure for instance-group-2 in the different zone of same region as subnet-a:
Click Create Instance group.
Set the following values, leave all other values at their defaults:
Property | Value (type value or select option as specified) |
---|---|
Name | instance-group-2 |
Instance template | instance-template-2 |
Location | Single-zone |
Region | |
Zone | Zone (Use the different zone in same region as subnet-a) |
Autoscaling > Minimum number of instances | 1 |
Autoscaling > Maximum number of instances | 5 |
Autoscaling > Autoscaling signals (click the dropdown icon to edit) > Signal type | CPU utilization |
Target CPU utilization | 80 |
Initialization period | 45 |
Click Create.
Verify that VM instances are being created in both subnets and create a utility VM to access the backends' HTTP sites.
Still in Compute Engine, click VM instances.
Notice two instances that start with instance-group-1
and instance-group-2
.
These instances are in separate zones and their internal IP addresses are part of the subnet-a and subnet-b CIDR blocks.
To create a new instance, click Create Instance.
In the Machine configuration.
Select the following values:
Property | Value (type value or select option as specified) |
---|---|
Name | utility-vm |
Region | |
Zone | |
Series | E2 |
Machine Type |
e2-micro (1 shared vCPU) |
Click Networking.
For Network interfaces, click Toggle to Edit network interface.
Specify the following:
Property | Value (type value or select option as specified) |
---|---|
Network | my-internal-app |
Subnetwork | subnet-a |
Primary internal IPv4 address | Ephemeral (Custom) |
Custom ephemeral IP address | 10.10.20.50 |
Click Done and then click Create.
Click Check my progress to verify the objective.
10.10.20.2
and 10.10.30.2
.instance-group-1-xxxx
, run the following command:The output should look like this:
instance-group-2-xxxx
, run the following command:The output should look like this:
Configure the Internal Load Balancer to balance traffic between the two backends (instance-group-1 and instance-group-2), as illustrated in this diagram:
my-ilb
.The backend service monitors instance groups and prevents them from exceeding configured usage.
Click on Backend configuration.
Set the following values, leave all other values at their defaults:
Property | Value (select option as specified) |
---|---|
Instance group | instance-group-1 |
Click Add a backend.
For Instance group, select instance-group-2.
For Health Check, select Create a health check.
Set the following values, leave all other values at their defaults:
Property | Value (select option as specified) |
---|---|
Name | my-ilb-health-check |
Protocol | TCP |
Port | 80 |
The frontend forwards traffic to the backend.
Click on Frontend configuration.
Specify the following, leaving all other values with their defaults:
Property | Value (type value or select option as specified) |
---|---|
Subnetwork | subnet-b |
Internal IP | Under IP address select Create IP address |
Specify the following, leaving all other values with their defaults:
Property | Value (type value or select option as specified) |
---|---|
Name | my-ilb-ip |
Static IP address | Let me choose |
Custom IP address | 10.10.30.5 |
Click Reserve.
In Port number, type 80
.
Click Done .
Click on Review and finalize.
Review the Backend and Frontend.
Click on Create. Wait for the Load Balancer to be created, before moving to the next task.
Click Check my progress to verify the objective.
Verify that the my-ilb
IP address forwards traffic to instance-group-1 and instance-group-2.
The output should look like this:
In the output, you should be able to see responses from instance-group-1 in
In this lab you created two managed instance groups in the
For information on the basic concepts of Load Balancing, see Google Cloud Load Balancing Documentation.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated January 30, 2025
Lab Last Tested January 30, 2025
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.