I have two services running and 4 different headers. I want to direct requests with headers a and c to one service and b and d to another service. What is the best way to achieve that in a virtual service manifests?
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sample_virtualservice
namespace: sample_namespace
spec:
hosts:
- sample_service.sample_namespace.svc.cluster.local
http:
- match:
- headers:
x-test:
exact: "a" OR "c" //This doesn't work but I want to achieve.
route:
- destination:
host: service_1.sample_namespace.svc.cluster.local
port:
number: 80
- route:
- destination:
host: service_2.sample_namespace.svc.cluster.local
port:
number: 80
I believe there must be a better way instead of mentioning the same route destination multiple times in a manifest file.