Recursive traffic routing Best Practices?

Hi everyone,

Is it possible to route traffic by applying traffic routing rules recursively?

Here is the situation: we have several independent routing rules, each of them can be described by one destination rule and one virtual service.

For example, we have three rules naming ruleA, ruleB and ruleC. According to ruleA, traffic match conditionA1 with be routed to subsetA1 and traffic match conditionA2 with be routed to subsetA2.Likewise, we have subsetB1 for conditionB1, subsetB2 for conditionB2 and subsetC1 for conditionC1, subsetC2 for conditionC2.

In that case, for traffic that matches conditionA1 and conditionB1 and conditionC1, we want it to be routed to the intersection of subsetA1, subsetB1 and subsetC1.

We have considered two solutions.

First one is to enumerate all possibilities of combinations of different routing rules in one destination rule and one virtual service. With the increase of the number of rules, the complexity and redundancy of configuration is becoming more and more unacceptable. In our case here, with four routing rules, each of which has more than 10 available subsets, the configuration is unreadable.

The second one is to define routing rules separately, then chain one virtual service to another. In that case, we will have clear configuration for each routing rule. However, we haven’t found out the proper choice of hosts in virtual service and destination rule to help us implement this solution.

Any help is appreciated.