Search This Blog

Wednesday, May 10, 2017

how to add a load balancer on google cloud platform ?

 

To add a load balancer as a front face to your application, you need to create an instance group first.

An instance group is a group of your instances which will be a front end for the load balancer backend service.

image

 

Lets create an instance group and add our instances to it.

 

image

 

Both of your instances should be listening on a port, because that will get requests from load balancer on that port.

 

image

Now create an HTTP load balancer

 

image

Create a new backend service.

image

 

Add your instance group which we created in earlier step here, so that backend service knows which all instances are available.

image

Create a health check of the instances, on the port your instances are listening.

 

 

image

Review the host name and path rules, in case you want to add mapping like.

/blog path should be mapped to a different instance group, that can be done here.

 

image

 

Review and create the LB, by default IP will not be static, its a good idea to get a static ip for your LB.

 

Keep Reading!

No comments:

Post a Comment