0

The following Virual Service consists of matching conditions for routing the Live DNS and Test DNS to two different versions of same service. Here, based on the second matching condition, the Test DNS must route to the Green subset, but instead it is routing to the Blue subset (as we have mentioned, the weight 100 for blue in first matching condition). That means the second matching condition's routing rules are getting overridden by the first matching condition's routing rules. All the indentations are also same.

Just as a brief

So, now the routing should be

Live DNS--->Blue

Test DNS --->Green

But instead it is routing as

Live DNS--->Blue

Test DNS ---> Blue

How to solve this issue?

 apiVersion: networking.istio.io/v1beta1
 kind: VirtualService
 metadata:
   name: int-vs
   namespace: stdy-ns 
 spec:
   gateways:
   - int-gateway

   hosts:
   - live.dns.com
   - test.dns.com


   http:
   - match:
     - headers:
         host:
           exact: live.dns.com
       
     - uri:
         prefix: /internal/platform/service
     route:
     - destination:
         host: service
         subset: blue
       weight: 100
     - destination:
         host: service
         subset: green
       weight: 0
   - match:
     - headers:
         host:
           exact: test.dns.com
    
     - uri:
         prefix: /internal/platform/service
     route:
     - destination:
         host: service
         subset: green
    

    
ouflak
  • 2,458
  • 10
  • 44
  • 49
  • How are you submitting the requests? And are you sure you are properly setting the host header for the test/green requests? – Gari Singh Feb 05 '22 at 10:00
  • Also, can you post your DestinationRule for "service"? – Gari Singh Feb 05 '22 at 10:21
  • Hi @GariSingh , thanks for the response. the Host header have set properly. So as the destination rules. The issue was in the prefix being used. And it was figured out. – Vasavi Elluru Feb 27 '22 at 10:10

0 Answers0