gRPC akka cluster client in k8s (Azure)

Hello,
I’m trying to set up gRPC akka cluster client to communicate with akka cluster inside k8s (Azure). I don’t understand what I’m doing wrong.

  • docker image has installation Open JDK 11
  • Used akka version 2.6.15 and akka grpc version 2.0.0
  • To upgrade our codebase I used as example Akka gRPC Quickstart with Java and locally everything works well
  • Akka cluster is deployed as stateful set inside k8s
  • How Cluster Client is configured:
    Config config = system.settings().config().getConfig("akka.cluster.client");
    GrpcClientSettings grpcClientSettings =
        GrpcClientSettings.fromConfig(config, system).withTls(false);

    return new ClusterClientSettings(config.getInt("buffer-size"), grpcClientSettings);
  }```


 Below is my akka client config:


```akka.cluster.client {
   
  service-discovery {
    mechanism = "config"
    service-name = "my-service"
    resolve-timeout = 15s
    port-name = "http"
    protocol = "tcp"
  }

    port = 2554

    backend = "netty"

    host = ""

    load-balancing-policy = ""

    deadline = infinite
    override-authority = ""
    user-agent = ""
    trusted = ""
    use-tls = false
    ssl-provider = ""
}

akka.discovery {
    method = config
    config.services = {
      my-service = {
        endpoints = [
          {
            host = "podname-0.my-service.default.svc.cluster.local"
            port = 2552
          },
          {
            host = "podname-1.my-service.default.svc.cluster.local"
            port = 2552
          },
          {
            host = "podname-2.my-service.default.svc.cluster.local"
            port = 2552
          }
        ]
      }
    }
}

akka.http.server.preview.enable-http2 = on```

It is expected that gRPC connection is established but I found those errors 
`io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2ConnectionHandler] [grpc-default-worker-ELG-1-1] [] - [id: 0x391610fc, L:/10.244.5.107:46370 ! R:podname-0.my-service.default.svc.cluster.local/10.244.5.98:2552] Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData 'readAddress(..) failed: Connection reset by peer'. Forcing shutdown of the connection.
io.grpc.netty.shaded.io.netty.channel.unix.Errors$NativeIoException: writevAddresses(..) failed: Broken pipe`

I suspect 2552 would be your Akka Remote port, not the port on which you have your Akka gRPC server running - so that might be the cause of the mismatch?

Thank you for the reply, I’ll check

You were right, thank you for the help :slightly_smiling_face:

1 Like