【发布时间】:2020-05-26 23:25:12
【问题描述】:
我正在尝试使用 GRPC 设置 ISTIO 网关。我使用的示例来自:https://github.com/h3poteto/istio-grpc-example。
此示例不包含网关。我添加了网关:
kind: Gateway
metadata:
name: my-gateway
namespace: istio-grpc-example
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: grpc-wildcard
protocol: GRPC
hosts:
- "*"
并修改了 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
还有什么我应该做的吗?我仍然无法通过网关...查询服务端点时收到错误。
谢谢!
【问题讨论】:
-
@请显示您的错误,我看到您使用的是子集,您是否定义了目标规则?
-
他们在这个例子中没有使用网关,所以你尝试过它是否适用于默认网关吗?正如@c4f4t0r 提到的,你能显示你的错误吗?您是否尝试过使用通配符主机? ¨*¨ 而不是 ¨backend¨。
-
谢谢大家的建议。我将端口号从 80 更改为 31400,并将主机从“后端”更改为“*”。现在看起来一切正常。