I am trying to set up the routes of two services in a kubernetes cluster, and I want to do a canary release of 2 different services with specific weighs. For example: if /endpoint1 is reached then it routes 50% of the traffic to service1, and for the other 50% I want to rewrite, then route to service2. If I try this virtual service
http:
- match:
uri:
exact: /path1
rewrite:
uri: /path1modified
route:
- destination:
host: service1host
weigh: 50
- destination:
host: service2host
weigh: 50
it will rewrite then route with path1modified. so I would need something like this
http:
- match:
uri:
exact: /path1
route:
- destination:
host: service1host
weigh: 50
- destination:
host: service2host
weigh: 50
rewrite:
uri: /path1modified
I am curios if this is possible. Thanks a lot.
UPDATE Thank you all for the answers given, eventually I found a way basically I had a webapp(which used path1) and I had a service(which used modifiedPath1 in the backend, but it needed path1 in browser, use rewrite) and I wanted to weight the traffic between these 2. I tried with virtual service, but I couldn't manage to find a way to include both paths. My solution was to add a traffic manager, which sends weighted traffic to webapp and my service, then for the webapp leave the endpoints as they are, and for the service if match uri exact /path1 then rewrite to modifiedPath1.