簡體   English   中英

Istio 虛擬服務不適用於 80 和 443 以外的端口

[英]Istio virtual service not working for port other than 80 and 443

我正在嘗試與gateway一起設置istio虛擬服務,但不知何故它不起作用。

這是我的網關配置

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: nginx-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        name: admin
        number: 9999
        protocol: HTTP
      hosts:
        - nginx.example.com

虛擬服務

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: nginx-virtualservice
spec:
  gateways:
    - nginx-gateway
  hosts:
    - nginx.example.com
  http:
    - match:
        - port: 9999
      route:
        - destination:
            host: nginx
            port:
              number: 80

但是,它僅適用於端口80和 `443,但不適用於其他端口。

很可能,當您創建 istio-ingressgateway 時,您使用了默認值,因此僅打開端口 80 和 443。 查看ingressgateway service/deployment,打開9999端口,在operator中添加即可。 現在您的網關正在偵聽端口 9999,但 go 流量可能無法通過它。

暫無
暫無

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

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