TIS1102 - VirtualService Points to Non-Existent Gateway
The VirtualService is configured to use a gateway that does not exist.
VirtualService References Valid GatewaysTo 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
-
VirtualServiceReferencing a Non-Existent GatewayapiVersion: 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
VirtualServicereferences a gateway namedunknown-gateway, but there is no correspondingGatewayresource defined in the mesh. This prevents theVirtualServicefrom 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.
-
Update the
gatewayField to Target an Existing GatewayUpdate the
gatewayreference 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 theVirtualServiceto function properly by routing traffic through the intended gateway. -
Remove the
gatewayField to Use the DefaultmeshGatewayIf no specific gateway is required, you can remove the
gatewayfield to use the defaultmeshgateway.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
gatewayfield causes theVirtualServiceto use the defaultmeshgateway, which is sufficient for internal routing within the mesh.