Reputation: 1136
I have VirtualService and Gateway pair to expose my service to outside. The VirtualService spec looks like below.
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: {{ .Values.domain }}-grpc
spec:
hosts:
- {{ .Release.Namespace }}.{{ .Values.env }}.{{ .Values.corporation }}.cloud
gateways:
- {{ .Values.domain }}
http:
- route:
- destination:
host: {{ .Values.domain }}
port:
number: 6565
However, when I create another VirtualService that is identical to the VirtualService above but with only different name, the new VirtualService doesn't work.
The scenario I'm trying to implement is when new VirtualService is created, actual traffic flows through the new VirtualService. When the new VirtualService is deleted, actual traffic should flow through the original VirtualService.
Is there any options or way to implement this scenario?
Upvotes: 0
Views: 1450
Reputation: 172
I idea is you should not have two Virtual Service with same host. If you do so, will create a conflict in the route.
You can refer to the Analysis Docs for more info: https://istio.io/latest/docs/reference/config/analysis/ist0109/
Upvotes: 0
Reputation: 8200
A VirtualService defines rules how to route traffic from the hosts to your services. In this sense, traffic does not "flow through" a VirtualService. So if they are identical, it should not make any difference which one is used.
Upvotes: 1