Scaled VM: Part 4. Load Balancer

Valentyn Shybanov
Google Cloud - Community
2 min readSep 23, 2017

How to configure auto balancer to handle requests in “Scaled VM” scenario

In previous posts I’ve described how to configure web hosting in your managed instances.

In this post I’ll describe how configure Load Balancer to handle requests to our VMs.

[Part 1: introduction] [Part 2: FS/VM] [Part 3: Web] [Part 4: Load Balancer] [Quick walkthrough]

Load Balancer configuration

Now we know that our instances will serve content from shared FS. But we need single IP to configure our DNS. And later, in case of high load, if Instance Group’s autoscaler decide to scale new VMs to handle the load, Load Balancer should distribute load through our VMs.

To set up this, you should go to Load Balancer tab on Cloud Console and create new HTTP(S) Load Balancer (you can press directly here to do so)

After entering name, you should click on “Backend configuration”, then “Create or select back-end services” and “Create a backend service”:

During creation of back end service, you’ll have to create new backend. There you can select instance group:

Also, there you need to create “Health Check”. Please be carefull and select HTTP as a protocol to check:

After you have created health check, you can save Backend configuration and continue to Frontend configuration:

Here is very important to create new public IP address. This address will be used in DNS configuration to access your scalable setup.

At the end you should have something like this:

If you done everything else, you should be able to access your system using public IP.

On next part I’ll describe how to add last missing point — CloudSQL as drop-in replacement of hosted MySQL.

--

--