How to get GRPC's round_robin load balancing to work using grpc-java in Kubernetes cluster? How to get GRPC's round_robin load balancing to work using grpc-java in Kubernetes cluster? kubernetes kubernetes

How to get GRPC's round_robin load balancing to work using grpc-java in Kubernetes cluster?


I found some issue of your code:

  1. In client, you should use forTarget rather than forAddress like dns:///grpc-receiver:6565, because kubernetes service route by dns, have a try for this name resolver, and make sure your server has multiple instances.
  2. The exception NoSuchFieldError: NAME_RESOLVER_SERVICE_CONFIG is caused by lib not match, the grpc-services version is 1.25.0, but grpc-core version is 1.34.1, so make them in same version, and it should be worked correcttly.