簡體   English   中英

ISTIO GRPC 網關配置

[英]ISTIO GRPC Gateway configuration

我正在嘗試使用 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

還有什么我應該做的嗎? 我仍然無法通過網關 go... 查詢服務端點時收到錯誤消息。

謝謝!

正如我在評論中提到的

您是否嘗試過使用通配符主機? *而不是backend

您需要更改虛擬服務主機

spec:
  hosts:
    - "backend"

spec:
  hosts:
    - "*"

@Ondra 補充說他改變的另一件事是網關端口號

我將端口號從 80 更改為 31400,並將主機從“后端”更改為“*”。 現在看起來一切正常。 – 翁德拉

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM