Contour: gRPC example

Created on 20 Oct 2018  路  8Comments  路  Source: projectcontour/contour

I'd really like a simple helloworld gRPC example. Everything else is working but I cant figure out how to implement gRPC

blockeneeds-info kinquestion

Most helpful comment

Hi,

Can someone please add a simple gRPC example to the documentation. I am struggling to get HTTP/2 working.

Thanks,
Varun

All 8 comments

Thank you for your issue. I'm sorry but I cannot assist you, you probably want to ask this question on the https://github.com/grpc/grpc project.

not gRPC itself but gRPC on contour @davecheney

I'm sorry i misunderstood your request.

Can you please list precisely what you are trying to do, what you have tried, and what happened when you tried. If you can include code, that would be very beneficial to be able to understand where you are stuck.

Hey @GoingFast, I think what you're looking for is the contour.heptio.com/upstream-protocol.h2 Contour Service annotation. Try setting this up in your gRPC Service manifest with the port number/name the server is bind to as the annotation value.

Yes I got it working thanks. Problem wasn't in Contour but my spec rules. I'm still fairly new to k8s so I'm not really sure if the setup I have currently is ok.

spec:
  rules:
    - host:
      http:
        paths:
          - path: /hello
            backend:
              serviceName: hello-server
              servicePort: grpc

and I dial hello-server.default.svc.cluster.local:50051. I write the hostnames and it seems to be working.

@GoingFast if you're dialing to hello-server.default.svc.cluster.local:50051 you're actually skipping Contour all together and hitting the app service directly.
Set a hostname on your ingress resource and point that domain to the Contour service internal (or external) IP address, then change the dial to use this new domain with port 80 or 443 (if TLS is configured).

I recommend reading the Kubernetes docs on Ingress resources so you understand all the layers involved: https://kubernetes.io/docs/concepts/services-networking/ingress/

@GoingFast please reopen this issue if you need more assistance.

Hi,

Can someone please add a simple gRPC example to the documentation. I am struggling to get HTTP/2 working.

Thanks,
Varun

Was this page helpful?
0 / 5 - 0 ratings