0

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?

  • [Here's article](https://kubernetes.io/blog/2018/11/07/grpc-load-balancing-on-kubernetes-without-tears/) about gRPC load balancing in k8s – Grigoriy Mikhalkin Nov 10 '20 at 17:39
  • 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 moment – Vardan Saakian Nov 10 '20 at 18:07

1 Answers1

2

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