Skip to main content
logoTetrate Istio SubscriptionVersion: Next

TIS1104 - Host Subset Combination Already Referenced in Another Route Destination

The specified host-subset combination is already referenced in another route destination within the VirtualService.

Recommendation: Avoid Duplicate Host-Subset References

To prevent conflicts and ensure predictable routing behavior, ensure each host-subset combination is only referenced once per RouteDestination. Consolidate duplicates or use unique subsets for different versions of the service.

Examples

  1. VirtualService with Duplicate Host-Subset Combinations

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

    Explanation: The VirtualService has two RouteDestination entries that reference the same host (my-app-service.example-namespace.svc.cluster.local) and subset (v1). Having multiple references to the same host-subset combination can lead to unpredictable routing behavior and configuration conflicts.

Recommendation

Ensure there is only one reference to the same host-subset combination for each RouteDestination.

  1. Consolidate Duplicate Host-Subset References

    Remove the duplicate RouteDestination to avoid conflicts, and if needed, adjust the weight accordingly.

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

    Explanation: Consolidating the duplicate entries ensures that each host-subset combination is referenced only once, preventing conflicts and ensuring that routing is handled as intended.

  2. Define Unique Subsets for Different Versions

    If the intention is to distribute traffic across multiple versions, define unique subsets for each version to ensure proper routing.

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

    Explanation: Using different subsets for different versions allows traffic to be distributed correctly between the subsets, enabling load balancing or canary deployment scenarios.