ReferencedResourceNotFound

当 Istio 资源引用不存在的另一个资源时,会出现此消息。当 Istio 尝试查找引用的资源但找不到时,会导致错误。

例如,您会收到以下错误

Error [IST0101] (VirtualService httpbin.default) Referenced gateway not found: "httpbin-gateway-bogus"

在此示例中,VirtualService 引用了不存在的网关

apiVersion: networking.istio.io/v1
kind: Gateway
metadata:
  name: httpbin-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http2
      protocol: HTTP2
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: httpbin
spec:
  hosts:
  - "*"
  gateways:
  - httpbin-gateway-bogus #  Should have been "httpbin-gateway"
  http:
  - route:
    - destination:
        host: httpbin-gateway

要解决此问题,请在详细的错误消息中查找资源类型,更正您的 Istio 配置,然后重试。