Search code examples
kubernetesistio

Query params match in Istio Virtual Service


In a Istio virtual service, I have this working match block:

 - match:
   - uri:
       prefix: "/whatever"

It's working fine. But now, besides uri, I need to match also 2 query params as well. I tried this:

 - match:
   - uri:
       prefix: "/whatever"
     queryParams:
       app-id:
         exact: "whatever"
       token:
         exact: "thisisthetoken"

It doesn't work. It doesn't redirect to destination. What am I doing wrong?


Solution

  • In my virtualservice.yaml, I defined queryParams directly under "- match" section and it worked fine.

    If I define queryParams under uri and save the changes, it is automatically getting moved out of the uri section and it doesn't work after that.

    Probably it means that the queryParams are global for all uris and not for sepecific uri