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.
Lets create an instance group and add our instances to it.
Both of your instances should be listening on a port, because that will get requests from load balancer on that port.
Now create an HTTP load balancer
Create a new backend service.
Add your instance group which we created in earlier step here, so that backend service knows which all instances are available.
Create a health check of the instances, on the port your instances are listening.
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.
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