Load balancer integration with Managed instance groups
GCP Internal Load balancing is architected using Andromeda, Google's virtualization
platform. With GCP load balancing, you can have your entire application available using a
single global IP address resulting in a simplified DNS setup.
You can use load balancing to distribute user requests among a set of instances. The
instances can be in the same region or different regions.
Step 1: Configure the load balancer details
• Navigate to Load balancing under Network services. In the pop-up screen, select Create load balancer button
• In the subsequent page, select the HTTP(S) Load balancing and click on Start Configuration button
• In the screen that appears, provide a name for the load balancer. Next, we have to configure Backend and front end forwarding rules.
Step 2: Attach back-end services to the load balancer
• Choose the Backend configuration section, which will display an extended configuration box towards the right side
• From the drop-down, select Create or select backend services & backend buckets
• Under Backend services, choose to Create a backend service.
• Name the back-end service group. A new window entitled "New backend" appears.
• Select the first instance group as the first back end service and configure values asp shown below. Click on the Done button
• Once done, you will have back-ends added under back-end configuration as shown below.
• For the Health check field, select the health check that you created before. Then click on the Update button
Step 3: Add front-end forwarding rules which maps load balancer IP to instance IP addresses
• In the Host and path rules section, continue with the default values.
• Select the Frontend configuration section, which will show an extended window. Provide the values as shown below
• Here, you can add both IPv4 and IPv6 addresses f or HTTP protocol. Under the IP address field, you have the option to reserve a global static external IP for the load balancer. Here, you will select Ephemeral for practice purposes.
• Similarly, you can configure IPv4 and IPv6 addresses f or HTTPS protocol also if required.
• Once completed, click on Done.
• After review and if no changes, click on Create button
Step 4: Access the load-balanced web application
• You can access the web application deployed on all the server machines using the load balancer IP address.
• Click on the demo-HTTP-load balancer and navigate to the Frontends tab.
• After few seconds, the health checks will be complete and the load balancer will be active.
• Copy the address and port and paste it to a browser url. You will see the response from the web application from any one of the servers under the load balancer
No comments:
Post a Comment