Skip to content
\n

And here are all the resources:

\n
apiVersion: gateway.networking.k8s.io/v1\nkind: Gateway\nmetadata:\n  name: foo-gateway\nspec:\n  gatewayClassName: istio\n  listeners:\n    - name: foo-grpc\n      hostname: \"localhost\"\n      port: 50051\n      protocol: HTTP\n---\napiVersion: networking.istio.io/v1\nkind: VirtualService\nmetadata:\n  name: foo-route\nspec:\n  gateways:\n    - foo-gateway\n  hosts:\n    - \"localhost\"\n  http:\n    - name: foo-route\n      route:\n        - destination:\n            host: foo-service.default.svc.cluster.local\n---\napiVersion: networking.istio.io/v1\nkind: DestinationRule\nmetadata:\n  name: reviews-destination\nspec:\n  host: foo-service.default.svc.cluster.local\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: foo-service\n  labels:\n    app: foo-app\nspec:\n  ports:\n    - name: grpc\n      port: 50051\n      appProtocol: k8s.io/grpc\n  selector:\n    app: foo-app\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: foo-deployment\n  labels:\n    app: foo-app\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: foo-app\n  template:\n    metadata:\n      labels:\n        app: foo-app\n    spec:\n      containers:\n        - name: foo-container\n          image: 'docker.io/grpc/java-example-hostname'\n          imagePullPolicy: IfNotPresent\n          ports:\n            - containerPort: 50051
\n

I can invoke the service directly:

\n
kubectl port-forward svc/foo-service 9090:50051\ngrpcurl -plaintext -format text -d 'name: \"Jimbo\"' localhost:9090 helloworld.Greeter/SayHello
\n

But when I instead port-forward to svc/foo-gateway-istio, I get this error:

\n
ERROR:\n  Code: Unimplemented\n  Message: \n
\n

I tried checking things out with Kubeshark and found the matching gRPC request, from foo-gateway-istio-77bc48898f-4b98h/envoy to itself (src and dst are the same). All the headers look right. Interestingly, the request's body (it says \"text/plain\" for some reason) is {\"field_1\":\"Jimbo\"} which almost seems to suggest there's some automatic gRPC-JSON transcoding going on, which would be super confusing.

\n

I would very much appreciate tips on debugging problems like this in general. It seems like Istio issues can be difficult to debug in general. Kubeshark is not providing much help here and the logs for the gateway pod (foo-gateway-istio-77bc48898f-4b98h) are stuck at Envoy proxy is ready. It will save me quite a bit of hair if anybody could also point out the small edit(s) to these resource definitions that I'm sure I'm naively missing.

","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"

Figured it out. I had to change the name of the port in the Service to either http2 or grpc. I figured specifying the appProtocol should have been enough, and was using \"new standard protocol\" names from kubernetes/enhancements#3727 i.e. k8s.io/grpc. Apparently this was confusing the gateway, because it wouldn't work until I removed the appProtocol field. I guess Istio doesn't support that KEP?

\n

Edit: should have dug a little deeper: kubernetes/kubernetes#116866

","upvoteCount":0,"url":"https://github.com/istio/istio/discussions/53877#discussioncomment-11249262"}}}

Minimal gRPC Gateway / Service on Minikube. #53877

Answered by ouillie
ouillie asked this question in Q&A
Discussion options

You must be logged in to vote

Figured it out. I had to change the name of the port in the Service to either http2 or grpc. I figured specifying the appProtocol should have been enough, and was using "new standard protocol" names from kubernetes/enhancements#3727 i.e. k8s.io/grpc. Apparently this was confusing the gateway, because it wouldn't work until I removed the appProtocol field. I guess Istio doesn't support that KEP?

Edit: should have dug a little deeper: kubernetes/kubernetes#116866

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@howardjohn
Comment options

@ouillie
Comment options

@ouillie
Comment options

@ouillie
Comment options

Answer selected by ouillie
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants