GRPC Gateway setup example

Hi All,

I am trying to setup ISTIO Gateway with GRPC. I am using example from:https://github.com/h3poteto/istio-grpc-example.

This example does not contain Gateway. I added the Gateway:

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: my-gateway
  namespace: istio-grpc-example
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: grpc-wildcard
      protocol: GRPC
    hosts:
    - "*"

and modified the VirtualService:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: backend
  namespace: istio-grpc-example
spec:
  hosts:
    - "backend"
  gateways:
  - my-gateway
  http:
  - match:
    - port: 50051
    route:
    - destination:
        host: backend
        subset: v0
      weight: 90
    - destination:
        host: backend
        subset: v1
      weight: 10

Is there somethig else I should do? I still cannot go through Gateway… Received an error when querying services endpoint.

Thank you!

1 Like

Why are we defining gateway to listen to port 80, but defining VirtualService to match port 50051?

@devnryn Isn’t this how it works? Gateway (80) matches to service (50051) ? Works fine for http

The virtual service must match a port on the gateway. The virtual service is adding a route in the gateway on for a specific port/domain/route. if the ports do not match istio does not know how to configure it. If you check your pilot logs you probably will see the error warn: no virtual service bound to gateway