I am new to GRPC and Cloud Run. I have written a very simple grpc java service. The same service works fine when I run them locally. However, when I deploy to cloud run,I am not able to call the grpc server. The grpc service is listening on port $PORT(8080) as specified in the document.
The server code is
Server server = ServerBuilder.forPort(port).addService(this).build();
server.start();
The following are the cloud run configurations for the grpc server
Ingress Control : Internal
Enabled Use HTTP/2 end-to-end
Authentication : Allow unauthenticated invocations
The java client which is also a cloud run service uses this code to connect with the grpc server
ManagedChannel channel = ManagedChannelBuilder.forAddress(grpcHost, grpcPort).usePlaintext().build();
SimpleGrpcServiceBlockingStub grpcStub = SimpleGrpcServiceGrpc.newBlockingStub(channel);
The grpcHost is xxxxx.a.run.app (without https) and the grpcPort is 8080.
The Client Cloud run service is configured with
Ingress Control : All (Allow direct access to your service from the internet)
Connect to a VPC for outbound traffic - Enabled
Send traffic directly to a VPC - uses default VPC
Traffic Routing - Route all traffic to the VPC
While running the client I get the following error
io.netty.channel.ConnectTimeoutException: connection timed out: xxx.run.app/216.239.32.53:8080
What am I mising here ? Any suggestions.
Any help is highly appreciated.
Thanks in advance.
Regards
Srinivasan