Google Cloud Load Balancer Active/Standby Decisions

clustergoogle-cloud-platformgoogle-compute-engineload balancing

I'm trying to create an active/passive cluster in GCP, and I'm looking at using the native load balancer to achieve this.
For example, I want the load balancer to only forward traffic to a particular set of nodes (the standby nodes) only if the main set of nodes (the active nodes) fails the health check.
I would have thought this would be possible, but I can't see any option which would allow me to achieve this. From what I can tell, only round robin load balancing is possible, or am I missing something?

Best Answer

Round robin load-balancing is used only for compute instances with in the same Managed Instance Group(MIG). If you want to have control over balancing modes, you need to put the active and passive nodes in separate nodes and regions/zones. Again, why bother with activie/passive nodes, when you can make your active nodes highly available by deploying them across multiple zones and regions? The GLB will pick the healthy active nodes.

If you think you still need active/passive nodes, as far as I know, GCP doesn't provide the exact feature you are asking, but I think you might get close by tweaking the balancingMode and capacity setting property of the GLB backend services resource. For instance, you can set the cpu utilization and capacity of standby nodes to almost zero(but not zero) and set it to 100% on active nodes. This way, the load balancer will send all or most of traffic to active nodes, only when active nodes fail, it will route traffic to passive nodes. Since GLB is also geo-based, you might put your active nodes in a MIG closer to the clients.

Reference - Google global HTTP load balancer documentation

Related Topic