VirtualServiceHostNotFoundInGateway

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

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

示例

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

  1. apiVersion: networking.istio.io/v1
  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/v1
  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.

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

如何修复

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