Create the Cloud Load Balancer on Google Cloud as described in Introduction to the Load Balancer, in the following order.
The client is able to communicate with the VM instances which are detected as healthy by the health check by connecting to the load balancer frontend IP address.
Create an Instance Group
Create the following two instance groups.
Instance Group List
Name | Region | Zone | Network | Subnetwork | VM instance |
lk-ig01 | asia-northeast1 | b | lk-vpc | lk-private | lk-node01 |
---|---|---|---|---|---|
lk-ig02 | c | lk-node02 |
- From the Navigation menu, select Compute Engine > Instance groups.
- Click CREATE INSTANCE GROUP and select New unmanaged instance group from the left pane.
- Enter the name for the instance group and select the region and zone. Select the Network and Subnetwork. Select the primary node under the VM instance and click Create.
- Repeat the steps to create the instance group on the secondary node.
- The instance groups have been created.
Create the Load Balancer
- From the Navigation menu, Select Network services > Load balancing.
- Click CREATE LOAD BALANCER and select TCP Load Balancing > Start configuration.
- Under Internet facing or internal only, select Only between my VMs. Set Multiple regions or single region to Single region only and click Continue.
- Enter the name for the new load balancer name (”lk-lb”) and click Backend configuration.
- Select the region and network and add the created two instance groups for the backend.
Under the Health checks, click Create a Health check. Enter the name and set TCP for Protocol and enter “12345” in the Port field. Click Save and continue.
Region | Network | Backend | Health check | ||
Instance group | Name | Protocol | Port | ||
asia-northeast1 | lk-vpc | lk-ig01, lk-ig02 |
lk-health-checks | TCP | 12345 |
---|
- Select Frontend configuration. Enter the name for the frontend.
Subnetwork: Public Subnet.
Internal IP:
IP address: Ephemeral(custom)
Purpose of Internal IP: Non-shared
Select Single for Ports and enter the port number. Click Done.
Click Create.
Name | Subnetwork | Internal IP | Port | |||
Purpose | IP address | Custom ephemeral IP address | Number | |||
lk-lb-frontend | lk-public | Non-shared | Ephemeral(custom) | 10.0.1.100 | Single | 1521 |
---|
- The load balancer has been created.
Post your comment on this topic.