I want to access dynamic value in VirtualService for uri I want to access dynamic value in VirtualService for uri kubernetes kubernetes

I want to access dynamic value in VirtualService for uri


Do the requests pass in a header named location with value of pune? If "no" then remove this from the matching rules - it is the cause for the requests not being matched by uri prefix alone:

    - headers:        location:          exact: pune

Just in case, here is a link to the relevant doc.


We can go with regex for uri.

 - match:      uri:        prefix: /pune    route:    - destination:        host: wagholi        port:          number: 8080 - match:      uri:        regex: \/pune/\/(.+)    route:    - destination:        host: yerwada        port:          number: 8080 - match:                    uri:        prefix: \/pune\/(.+)\/here    route:    - destination:        host: hadapsar        port:          number: 8080