knative-extensions / net-kourier

Purpose-built Knative Ingress implementation using just Envoy with no additional CRDs
Apache License 2.0
291 stars 80 forks source link

gRPC web support #937

Open kahirokunn opened 1 year ago

kahirokunn commented 1 year ago

I want to use gRPC web with Knative serving + Kourier, how do I set it up to work? Envoy has gRPC web support.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

kahirokunn commented 1 year ago

keep

ReToCode commented 1 year ago

Are you trying anything specific? This should work with setting the container port like this:

        ports:
          - name: h2c

See https://github.com/knative/docs/tree/main/code-samples/serving/grpc-ping-go for a full example.

kahirokunn commented 1 year ago

gRPC Web needs to add a dedicated envoy filter It doesn't work by itself!

ReToCode commented 1 year ago

Ah I see. We do not currently support custom envoy configuration for Kourier. I'll add this as an RFE. For now you could try to use https://github.com/knative-sandbox/net-istio as an ingress-controller for Knative. Istio allows to add custom envoy filters as a CR.

kahirokunn commented 1 year ago

Okay. Thx 🙏

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

kahirokunn commented 1 year ago

keep

wSedlacek commented 7 months ago

I was looking at setting up knative with grpc-web but was hitting this as a blocker.

I am considering adopting knative for my team but this requires not only having a production environment running knative but development environments locally for my team. Installking kind and using quickstart to setup knative is easy enough, however quickstart doesn’t provide an option for using istio for networking when using this method.

This said the problem for me isn’t that there isn’t a way to get knative working with grpc-web, but rather that it isn’t easy to setup on development machines.

istio had a PR some time back that automatically setup the envoy filters when ports were named with a prefix of grpc-web- https://github.com/istio/istio/pull/10064 Perhaps something similar could be done with Kourier?

Not sure how transferable this code but this apepars to be the actual filter that is getting applied for context. https://github.com/envoyproxy/go-control-plane/blob/main/envoy/extensions/filters/http/grpc_web/v3/grpc_web.pb.go