I'm looking for a way to have two GKE clusters (primary and backup) in different regions and direct traffic to the backup cluster when the primary one is unreachable.
I found a way to create a HTTP(s) load balancer with a backend service that has instance groups in different regions, but I can't find a way to configure this backend service to direct traffic to a single backend when it is available. Adjusting rate or utilization does not seem to ensure that the request will be sent to the primary cluster.
Someone has encountered a similar issue here.
Is there a way to do this with the GCP load balancing options? Maybe I missed it?
Hi,
I understand where you are coming from regarding how the traffic is distributed once you use GCPs Cloud Load balancer since it is not working as how other load balancer works. Based on its documentation[1], it was mentioned that Global Https load balancer optimized the backend instance selection for each request.
From this link[2] on task number 4 wherein the activity shows a stress test it was mentioned that traffic is forwarded to the closest backend but if the load is very high, traffic can be distributed across the backends.
However, there is a feature under TCP load balancer wherein you can configure a primary backend and a failover backend. You can follow this link[3] as a guide to configure this feature.
[1]https://cloud.google.com/load-balancing/docs/https#load_distribution_algorithm
[2]https://www.cloudskillsboost.google/focuses/1232?parent=catalog
[3]https://cloud.google.com/load-balancing/docs/network/networklb-setting-up-failover
Hi @VannGuce,
Thank you very much for the suggestion. I did check out the TCP load balancer which has failover options (relevent documentation for who needs it) and it looks like a solution I was looking for.
The only issue is that the TCP load balancer is regional and the failover backend has to be in the same region and I was looking for a way to set up the backup backend in a different region.
Hi @Justas ,
One possible solution (at a higher cost though) would be to use a separate LB in each region & Cloud DNS configured with a failover routing policy[1]. This topology would be similar to the architecture that's described in [2].
[1] https://cloud.google.com/dns/docs/policies-overview#failover-policy