Load balance to multiple gRPC hosts external to the mesh


I have a set of hosts outside my mesh hosting a gRPC service. I want to set Istio egress gateway to act as a proxy between these hosts, so local client code can just connect to “myservice” and have the request routed round robin to one of these gRPC hosts. LinkerD seems capable of this…

Question is how do I do this with Istio? I have read through the Gateway, VirtualService, and ServiceEntry but not quite sure how to set that up.



Any service outside the mesh will need to be added as ServiceEntry, https://istio.io/docs/reference/config/networking/v1alpha3/service-entry/

The resolution https://istio.io/docs/reference/config/networking/v1alpha3/service-entry/#ServiceEntry-Resolution DNS|None|Static is what you would have to tune as per how your gRPC service is setup



I have a similar issue to @cleverguy25.

I have a set of hosts that are defined using DNS.
I have defined my ServiceEntry to point at them.

Then I start my client in its own pod, with its istio-proxy sidecar, and configure it to talk to the DNS name.
My client resolves the DNS name to the IPs of the hosts (these are external to the mesh). Then it opens separate, long-lived grpc/http2 connections meant for each of the hosts. I believe those connections are routed through the istio-proxy.

This is surprising to me, because it seems to imply that the client is expected to perform clientside load balancing, which I’d like to avoid.

I’d like to alter the behavior so that my client opens a single grpc/http2 connection to istio-proxy and that istio provides the load balancing.
I have been trying to play with ServiceEntry.Resolution to alter this behavior, but it doesn’t seem to make a difference for me.