Consul Connect - gRPC Connection Failure

Hi All,

I am building a sample application for a POC. In my Kubernetes cluster I have my grpcserver and client (running in different pods) . I have installed consul with connect enabled using the official helm chart V0.31.1.

The major configurations that were used are :
client:
enabled: true
grpc: true
exposeGossipPorts: true
connectInject:
enabled: true
grpc: true

connect:
enabled: true

I have created two services grpcserver and client.

I have set proxy defaults for both grpcserver and client to support protocol “grpc”.

In my grpcserver deployment I have added the following annotations
consul.hashicorp.com/connect-inject’: ‘true’

In my client deployment I have added
consul.hashicorp.com/connect-inject’: ‘true’

On deployment the grpcserver pod runs as per expected . The client pod is not able to make connection to the grpcserver and fails with the error

HTTP/2 connection could not be established because the server did not complete the HTTP/2 handshake.\u0022, DebugException=\u0022System.Net.Http.HttpRequestException: An HTTP/2 connection could not be established because the server did not complete the HTTP/2 handshake.

Is there any special configuration that we must enable to help grpc communication between two pods in consul-connect . Is there any documentation on this that I can refer to ?

Any help is greatly appreciated!

Few options I have tried include
Enable/Disable Transparent Proxy
Change Default Protocols to tcp , http2
Also enable communication between grpcserver and client through service intentions

Thanks,
Monisha.

Hey @Movis1605

How is you client connecting to the grpc server? Are you using kube DNS? In other words, which address are you using?

It’d help if you can post your yaml configurations for the grpc client and server, as well as proxy (or maybe service?) defaults so that we can help figure out if there’s a misconfiguration.

Thank you for responding to the post .

Update :

We have been able to get the GRPC communication work between our test GRPCServer and Client .

However we are not able to get both GRPC and HTTP protocol to work for our service.

Our requirement is GRPCServer Service should support both GRPC and HTTP Protocol .

Here are the test config files we have used .

consul-config.txt (804 Bytes)
servicedefaults.txt (373 Bytes)
serviceintention.txt (393 Bytes)
testservicesmultiportconfig.txt (2.7 KB)

Please let us know if you have any suggestions.