Add custom header for 50% requests to single backend service


We have a new requirement as detailed below. Just trying to explore the possible solutions using Istio. Any ideas around this would be highly appreciated.


A configured percentage of incoming requests towards a service should have a custom header added. For eg: 50% of total requests to the service should have a header added or check if the header exists. Based on the custom header value, application enables additional features for the target users. Instead of multiple revisions of same deployment, they wanted to deploy only single deployment and enable progressive rollout using this approach.

One approach that I learned from the documentation was - to have revisions defined using destination rule and then route a configured percentage traffic to different versions. However, not sure if we can follow the similar approach for a deployment having only single revision. Please let me know if you have come across a similar requirement and the possible solutions.