2

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:

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!

Ondra
  • 21
  • 2
  • @please show your error, I see that you are using subsets, did you define destination rules? – c4f4t0r May 26 '20 at 23:30
  • They didn´t use gateway in this example, so did you try if it works with default gateway? As @c4f4t0r mentioned could you show your errors? Have you tried with wildcard hosts? ¨*¨ instead of ¨backend¨. – Jakub May 27 '20 at 07:05
  • 1
    Thank you all for your advice. I changed the port number from 80 to 31400 and changed the host from "backend" to "*". Now it looks like everything is working. – Ondra May 27 '20 at 11:29

1 Answers1

1

As I mentioned in comments

Have you tried with wildcard hosts? * instead of backend?

You need to change virtual service hosts.

spec:
  hosts:
    - "backend"

to

spec:
  hosts:
    - "*"

And @Ondra add that other thing he changed was the gateway port number.

I changed the port number from 80 to 31400 and changed the host from "backend" to "*". Now it looks like everything is working. – Ondra

Jakub
  • 8,189
  • 1
  • 17
  • 31