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:
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.
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.
You can only use internet NEGs on the Premium network service tier, which is the default tier.
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
?
You can consider following options -
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.
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.