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
Configure HTTP and health check firewall rules
/ 40
Configure instance templates and create instance groups
/ 30
Configure the Internal Load Balancer
/ 30
Google Cloud's Internal Load Balancing (ILB) is a crucial service for managing and scaling your private application infrastructure. It enables you to distribute TCP/UDP-based traffic efficiently across internal virtual machine instances, ensuring that your applications are highly available and performant within your private network. By providing a single, stable private IP address for your services, ILB simplifies internal application communication and enhances system resilience.
In this lab, you set up an internal service by creating two managed instance groups in the same region, representing a common deployment pattern for highly available applications. Then, you configure and thoroughly test an Internal Load Balancer, using these instance groups as its backends. This setup mimics a real-world scenario where an internal application, such as a microservice, an API endpoint, or a database, needs to be accessible to other internal services or applications without exposure to the public internet.
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 right is the Lab setup and access panel with the following:
Note that the lab timer is located near the top of the page, showing the remaining time.
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 setup and access panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab setup and access panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Proper firewall rules are the foundation of a secure and functional internal load-balanced environment. They ensure that only authorized traffic reaches your backend services and that the load balancer can accurately assess the health of your instances.
Configure firewall rules to allow HTTP traffic to the backends and TCP traffic from the Google Cloud health checker.
The lab environment preconfigures the my-internal-app network with subnet-a and subnet-b, along with firewall rules for RDP, SSH, and ICMP traffic.
In the Google Cloud console, on the Navigation menu, select VPC network > VPC networks.
Scroll to view the my-internal-app network and its subnets: subnet-a and subnet-b.
Each Google Cloud project starts with the default network. In addition, the lab environment creates the my-internal-app network shown in the network diagram.
You 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).
In the VPC network navigation menu, select Firewall.
The lab environment preconfigures the app-allow-icmp and app-allow-ssh-rdp firewall rules.
Click Create firewall rule.
Set the following values, and leave the remaining settings as 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, select TCP, and 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.
On the Firewall page, click Create firewall rule.
Set the following values, and leave the remaining settings as 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, 35.191.0.0/16 |
| Protocols and ports | Specified protocols and ports, and then select TCP |
Click Check my progress to verify the objective.
Instance templates and managed instance groups are the backbone of scalable, resilient, and manageable applications. They allow you to define a standard configuration for your VMs and then automatically manage their lifecycle, ensuring consistency and enabling automated scaling and self-healing.
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 Google Cloud console, on the Navigation menu, select 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, type lb-backend
lb-backend ensures that the HTTP and health check firewall rules apply to these instances.For Network interfaces, click the drop-down icon to edit.
Set the following values, and leave the remaining settings as 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.
In the Automation > Startup script field, paste the following script:
Wait until Compute Engine creates the instance template.
Create another instance template for subnet-b by copying instance-template-1. This demonstrates how easy it is to replicate configurations across different subnets or zones for high availability and disaster recovery strategies.
Managed instance groups (MIGs) are key to robust, self-healing, and dynamically scaling applications. They automatically replace unhealthy instances and can scale your application capacity based on demand, ensuring that your services remain available and performant without constant manual intervention. This is crucial for handling variable loads and maintaining Service Level Objectives (SLOs).
Configure one managed instance group in subnet-a and one in subnet-b.
subnet-a. For example, if subnet-a uses us-west2-a, you can select us-west2-b for subnet-b.In the Compute Engine navigation menu, select Instance groups.
Click Create instance group.
Set the following values, and leave the remaining settings as 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 | 1 |
| Autoscaling > Autoscaling signals (click the drop-down icon to edit) > Signal type | CPU utilization |
| Target CPU utilization | 80 |
| Initialization period | 45 |
Repeat the procedure to create instance-group-2 in a different zone in the same region as subnet-a:
Click Create instance group.
Set the following values, and leave the remaining settings as 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 | A different zone in the same region as subnet-a |
| Autoscaling > Minimum number of instances | 1 |
| Autoscaling > Maximum number of instances | 1 |
| Autoscaling > Autoscaling signals (click the drop-down icon to edit) > Signal type | CPU utilization |
| Target CPU utilization | 80 |
| Initialization period | 45 |
Click Create.
Verify that Compute Engine creates VM instances in both subnets, and create a utility VM to access the backends' HTTP sites directly. This step confirms individual backend functionality before introducing the load balancer, ensuring proper setup of your service tier.
In the Compute Engine navigation menu, select VM instances.
Verify that two instances starting with instance-group-1 and instance-group-2 appear. 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.
Under Machine configuration, set the following values, and leave the remaining settings as their defaults:
| 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 the toggle icon to edit the network interface, and set the following values:
| 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.
Click Create.
Click Check my progress to verify the objective.
The internal IP addresses for the backends are 10.10.20.2 and 10.10.30.2.
curl commands.instance-group-1-xxxx, run the following command:The output should resemble the following:
instance-group-2-xxxx, run the following command:The output should resemble the following:
curl commands demonstrate that each VM instance lists the Client IP and its own name and location. This is useful when you verify that the Internal Load Balancer sends traffic to both backends.utility-vm, run the following command:Configuring the ILB centralizes access to your backend services, provides a single point of entry for internal traffic, and ensures intelligent traffic distribution based on the health and capacity of your instances. This step is crucial for achieving the high availability and scalability benefits discussed earlier, acting as a centralized access point for your distributed service.
Configure the Internal Load Balancer to balance traffic between the two backends (instance-group-1 and instance-group-2), as illustrated in this diagram:
The backend service is the intelligence behind the ILB, defining how the load balancer distributes traffic and monitors instance health. It's essential for ensuring that traffic flows only to operational instances and preventing overload. This is also where you configure advanced features like session affinity to keep a user's connection on the same backend, or connection draining for graceful backend updates.
The backend service monitors instance groups and prevents them from exceeding configured usage.
Click Backend configuration.
Set the following value, and leave the remaining settings as 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, and leave the remaining settings as their defaults:
| Property | Value (select option as specified) |
|---|---|
| Name | my-ilb-health-check |
| Protocol | TCP |
| Port | 80 |
Verify that a check mark appears next to Backend configuration in the Google Cloud console. If not, confirm that you completed all the previous steps.
The frontend is the exposed interface of your ILB. By assigning a static internal IP address, you provide a consistent and predictable endpoint for other internal services to connect to, simplifying your application architecture, enabling easy service discovery within your VPC, and improving reliability.
The frontend forwards traffic to the backend.
Click Frontend configuration.
Set the following values, and leave the remaining settings as their defaults:
| Property | Value (type value or select option as specified) |
|---|---|
| Subnetwork | subnet-b |
| Internal IP | Under IP address, select Create IP address |
Set the following values, and leave the remaining settings as 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.
For Port number, type 80
Click Done.
Wait until Google Cloud creates the load balancer before moving to the next task.
Click Check my progress to verify the objective.
The final test validates that the ILB distributes traffic across healthy backend instances. This confirms that your internal services are now more resilient and scalable, using the core benefits of the ILB, and that private connectivity works properly.
Verify that the my-ilb IP address forwards traffic to instance-group-1 and instance-group-2.
The output should resemble the following:
10.10.30.5) forwards traffic to the backend.In the output, you see responses from instance-group-1 in instance-group-2 in a different zone in the same region. The load balancer distributes traffic across the backend instances, proving its efficacy in ensuring high availability and distributing load.
You have successfully configured and tested an Internal Load Balancer, understanding its critical role in building robust, scalable, and secure internal applications on Google Cloud.
For information on the basic concepts of load balancing, see the 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 November 16, 2026
Lab Last Tested May 11, 2026
Copyright 2026 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.
This content is not currently available
We can notify you via email when it becomes available
Great!
We can contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one