ConflictingMeshGatewayVirtualServiceHosts

Message NameConflictingMeshGatewayVirtualServiceHosts
Message CodeIST0109
DescriptionConflicting hosts on VirtualServices associated with mesh gateway
LevelError

This message occurs when Istio detects an overlap between virtual service resources that conflict with one another. For example, multiple virtual services defined to use the same hostname and attached to a mesh gateway will generate an error message. Note that Istio supports merging of virtual services that are attached to the ingress gateways.

Resolution

To resolve this issue, you can take one of the following actions:

  • Merge the conflicting virtual services into a single resource.
  • Make the hostnames unique across virtual services attached to a mesh gateway.
  • Scope the resource to a specific namespace by setting the exportTo field.

Examples

The productpage virtual service in namespace team1 conflicts with the custom virtual service in team2 namespace because both of the following are true:

  • They are attached to the default “mesh” gateway as no custom gateway is specified.
  • They both define the same host productpage.default.svc.cluster.local.
  1. apiVersion: networking.istio.io/v1
  2. kind: VirtualService
  3. metadata:
  4. name: productpage
  5. namespace: team-1
  6. spec:
  7. hosts:
  8. - productpage.default.svc.cluster.local
  9. http:
  10. - route:
  11. - destination:
  12. host: productpage
  13. ---
  14. apiVersion: networking.istio.io/v1
  15. kind: VirtualService
  16. metadata:
  17. name: custom
  18. namespace: team-2
  19. spec:
  20. hosts:
  21. - productpage.default.svc.cluster.local
  22. http:
  23. - route:
  24. - destination:
  25. host: productpage.team-2.svc.cluster.local
  26. ---

You can resolve this issue by setting the exportTo field to . so that each virtual service is scoped only to its own namespace:

  1. apiVersion: networking.istio.io/v1
  2. kind: VirtualService
  3. metadata:
  4. name: productpage
  5. namespace: team-1
  6. spec:
  7. exportTo:
  8. - "."
  9. hosts:
  10. - productpage.default.svc.cluster.local
  11. http:
  12. - route:
  13. - destination:
  14. host: productpage
  15. ---
  16. apiVersion: networking.istio.io/v1
  17. kind: VirtualService
  18. metadata:
  19. name: custom
  20. namespace: team-2
  21. spec:
  22. exportTo:
  23. - "."
  24. hosts:
  25. - productpage.default.svc.cluster.local
  26. http:
  27. - route:
  28. - destination:
  29. host: productpage.team-2.svc.cluster.local
  30. ---