Skip to main content
logoTetrate Istio SubscriptionVersion: Next

TIS1102 - VirtualService Points to Non-Existent Gateway

The VirtualService is configured to use a gateway that does not exist.

Recommendation: Ensure VirtualService References Valid Gateways

To avoid configuration issues and ensure traffic is properly routed, update the gateway field in the VirtualService to reference an existing gateway, or remove it to use the default mesh gateway if applicable.

Examples

  1. VirtualService Referencing a Non-Existent Gateway

    apiVersion: networking.istio.io/v1beta1
    kind: VirtualService
    metadata:
    name: my-virtual-service
    namespace: example-namespace
    spec:
    hosts:
    - "my-app.example.com"
    gateways:
    - "unknown-gateway"
    http:
    - route:
    - destination:
    host: "my-app-service.example-namespace.svc.cluster.local"

    Explanation: The VirtualService references a gateway named unknown-gateway, but there is no corresponding Gateway resource defined in the mesh. This prevents the VirtualService from properly routing external traffic through the intended gateway.

Recommendation

Update the gateway field to target all necessary gateways or remove the field if the default mesh gateway is sufficient.

  1. Update the gateway Field to Target an Existing Gateway

    Update the gateway reference to point to a valid gateway that is defined in the mesh.

    apiVersion: networking.istio.io/v1beta1
    kind: VirtualService
    metadata:
    name: my-virtual-service
    namespace: example-namespace
    spec:
    hosts:
    - "my-app.example.com"
    gateways:
    - "existing-gateway"
    http:
    - route:
    - destination:
    host: "my-app-service.example-namespace.svc.cluster.local"

    Explanation: Correcting the gateway reference to an existing gateway (existing-gateway) allows the VirtualService to function properly by routing traffic through the intended gateway.

  2. Remove the gateway Field to Use the Default mesh Gateway

    If no specific gateway is required, you can remove the gateway field to use the default mesh gateway.

    apiVersion: networking.istio.io/v1beta1
    kind: VirtualService
    metadata:
    name: my-virtual-service
    namespace: example-namespace
    spec:
    hosts:
    - "my-app-service.example-namespace.svc.cluster.local"
    http:
    - route:
    - destination:
    host: "my-app-service.example-namespace.svc.cluster.local"

    Explanation: Removing the gateway field causes the VirtualService to use the default mesh gateway, which is sufficient for internal routing within the mesh.