Score:0

Load Balancing Endpoints Outside of Google Cloud using GCP HTTP(S) or TCP/UDP Load Balancer

cn flag

I have a requirement to load balance to endpoints https://api1.app.com and https://api2.app.cpm that are currently outside GCP.

GCP provides Internet NEGs to plugin endpoints external to GCP to the HTTP(S) External load balancer. However, it has limitations.

Mainly:

  1. Load balancing is currently not supported on internet endpoints – the requests are only proxied to the endpoint. Google Edge infrastructure terminates your user connections and then directs the connections to your internet endpoint.

  2. No health checking is performed for the internet NEG. If your internet endpoint becomes unreachable or if it is specified as an FQDN but cannot be resolved, Cloud CDN sends a 502 (Bad Gateway) message in response to user requests.

  3. You can only use internet NEGs on the Premium network service tier, which is the default tier.

Reference

I cannot really use Internet NEGs to load balance my endpoints. Is there any other option available in GCP to achieve load balancing for endpoint external to GCP using GCP Load Balancers?

Can I plugin HAProxy or any other third party load balancing solutions in between the GCP Load Balancers and my backend endpoints?

If so, can we configure domain names such as https://api1.app.com and https://api2.app.cpm as backend in haproxy.cfg?

Michael Hampton avatar
cz flag
Why does this have to be on GCP?
bakadevops avatar
cn flag
@MichaelHampton, it is because a part of infra is on-prem and we can't move it to GCP quickly. We are in process but we need more time. Meanwhile, I was looking for a solution like this.
Score:0
cn flag

You can consider following options -

  1. Traffic director with hybrid connectivity NEGs - It combines Traffic Director capabilities with Cloud Load Balancing to bring Google Cloud networking services to multi-environments; unlike internet NEGs, it also provides health checks for private IP ports.

  2. This also answers one of your questions, as you can use third party networking tools like HAproxy, Traefik Enterprise etc in tandem with GCP networking resources for your use case. Check here for help in mapping domain names to backend server pools with HAProxy. For connecting HAProxy through GCP Internal TCP/UDP Load Balancing, check this.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.