I’m trying to manage 2 “hosts” on my VS and then, depending on which “host” the request is for, route to different backends versions.
So, the expected behavior is that, if I make this call I get to the v2 backend app, which is working.
curl http://$INGRESS_HOST:$INGRESS_PORT -H "Host: xp.example.com"
I would then expect that if I make the following request, I would get to the v1 backend app as a fallback but this is not working, I get a 404.
curl http://$INGRESS_HOST:$INGRESS_PORT -H "Host: www.example.com"
Here the Virtualservice configuration:
apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: backend-vs namespace: default spec: gateways: - demo-gateway hosts: - "www.example.com" - "xp.example.com" http: - match: - authority: exact: xp.example.com #regex: ^(?!.*www\.example\.com).*$ uri: prefix: / route: - destination: host: backend.default.svc.cluster.local subset: v2 port: number: 80 - match: - uri: prefix: / route: - destination: host: backend.default.svc.cluster.local subset: v1 port: number: 80
After few hours of attempts I’m starting wondering if this is even “supported” or if I simply miss some concept.
Could someone give me an hints?
Here I’ve created a repo to reproduce the issue on minikube, it takes 2 minutes of copy&paste to see the issue:
k8s version: 1.17.0