VirtualServiceHostNotFoundInGateway

消息名称VirtualServiceHostNotFoundInGateway
消息代码IST0132
描述Host defined in VirtualService not found in Gateway.
等级Warning

当一个 Virtual Service 声明了 host,但是无法找到相应的网关时,会出现此消息。

示例

当您的集群中包含以下 Virtual Service 时:

  1. apiVersion: networking.istio.io/v1alpha3
  2. kind: VirtualService
  3. metadata:
  4. name: testing-service
  5. namespace: default
  6. spec:
  7. gateways:
  8. - istio-system/testing-gateway
  9. hosts:
  10. - wrong.com
  11. http:
  12. - match:
  13. - uri:
  14. prefix: /
  15. route:
  16. - destination:
  17. host: ratings

同时还包含如下 Gateway:

  1. apiVersion: networking.istio.io/v1alpha3
  2. kind: Gateway
  3. metadata:
  4. name: testing-gateway
  5. namespace: istio-system
  6. spec:
  7. selector:
  8. istio: ingressgateway
  9. servers:
  10. - hosts:
  11. - testing.com
  12. port:
  13. name: http
  14. number: 80
  15. protocol: HTTP

您将会收到以下信息:

  1. 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.

在这个示例中, Virtual Service testing-service 拥有域名 wrong.com ,但是该域名没有声明在网关 testing-gateway 中。

解决方案

确保 Virtual Service 中所有 hosts 都已绑定到了相应的网关 hosts 中。