VirtualServiceHostNotFoundInGateway
當在虛擬服務中定義的 host
在對應的閘道中找不到時,會發生此訊息。
範例
當您的叢集具有下列虛擬服務時,您會收到此訊息
Warning [IST0132] (VirtualService testing-service.default testing.yaml:8) one or more host [wrong.com] defined in VirtualService default/testing-service not found in Gateway istio-system/testing-gateway.
當您的叢集具有下列虛擬服務時,您會收到此訊息
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: testing-service
namespace: default
spec:
gateways:
- istio-system/testing-gateway
hosts:
- wrong.com
http:
- match:
- uri:
prefix: /
route:
- destination:
host: ratings
以及下列閘道
apiVersion: networking.istio.io/v1
kind: Gateway
metadata:
name: testing-gateway
namespace: istio-system
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- testing.com
port:
name: http
number: 80
protocol: HTTP
在此範例中,虛擬服務 testing-service
的主機 wrong.com
並未包含在閘道 testing-gateway
中。
如何解決
請確保虛擬服務中的所有 hosts
都包含在綁定到該虛擬服務的閘道的 hosts
中。