0
votes

I have a headless service running with multiple replicas. When trying to verify client-side load balancing using round robin I see that all requests end up in the same replica. Client setup looks like following:

 conn, err := grpc.Dial(
        address,
        grpc.WithInsecure(),
        grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`),)

I've verified multiple endpoints in service. I also verified that service resolves to these multiple IP, but somehow it does connect only to the first pod in that list. MAX_CONNECTION_AGE is set to 30s on the server side to ensure client re-connects occasionally in case there has been a scale-up. I've followed numerous articles on how to set this up and it just does not work. What am I missing?

1
Here's article about gRPC load balancing in k8sGrigoriy Mikhalkin
Thanks, I read this article as well. We would like not to use any proxy and keep only a client-side load-balancing at the momentVardan Saakian

1 Answers

1
votes

The key was to explicitly use dns:/// as a prefix to target. Despite the fact it is stated as a default in documentation.