argoproj / argo-rollouts

Progressive Delivery for Kubernetes
https://argo-rollouts.readthedocs.io/
Apache License 2.0
2.79k stars 875 forks source link

How to provide URL rewrite in header route in Argo Rollout durring canary promotion #3089

Open sanjaydec2015 opened 1 year ago

sanjaydec2015 commented 1 year ago

Discussed in https://github.com/argoproj/argo-rollouts/discussions/3087

Originally posted by **sanjaydec2015** October 9, 2023 I am having a demo application called frontend which I am exposing on a subpath /demo using the folowing virtualservice apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: frontend namespace: argo-demo spec: gateways: - demo-gateway hosts: - xyz.demo.com http: - name: primary match: - uri: exact: /demo rewrite: uri: / route: - destination: host: frontend.argo-demo.svc.cluster.local port: number: 80 weight: 100 - destination: host: frontend-canary.argo-demo.svc.cluster.local port: number: 80 weight: 0 Using Argo Rollout I am trying to deploy a new version of frontend application using canary, in the rollout for canary I specify a header match condtion to route traffic to canary version if it matches the header, durring canary promotion, Argo Rollout updates the above virtualserrvice with a new route rule (header-route) for the header match, which is as shown below. kind: VirtualService apiVersion: networking.istio.io/v1beta1 metadata: name: frontend namespace: argo-demo spec: hosts: - xyz.demo.com gateways: - demo-gateway http: - name: header-route match: - headers: canary: exact: canary-tester route: - destination: host: frontend-canary port: number: 80 weight: 100 - name: primary match: - uri: exact: /test123 route: - destination: host: frontend.argo-demo.svc.cluster.local port: number: 80 weight: 100 - destination: host: frontend-canary.argo-demo.svc.cluster.local port: number: 80 rewrite: uri: / when argo rollout creates new header match route rule, it does no add the URL rewrite, since the frontedservice expect the request in the root context ie "/", so the calls to the service with the specific header gives a 404 error as the URI rewrite is missing in the header match route rule created by Argo rollout at runtime, so please advice is there solution to resolve this issue. ![image](https://github.com/argoproj/argo-rollouts/assets/16384108/01e79d56-3e85-4234-a570-84d7155952d9)
zachaller commented 1 year ago

This is actually currently a missing feature, we need some one to specify a template or reference to create the routes from so this is not supported today. You might be able to do something with delegated virtual service as a work around but have not looked into it with great detail.

chit786 commented 2 months ago

Hi @zachaller , we also wanted to try out header based routing for some of our cases with argo rollouts but stumbled upon this limitation. Is there any plans on supporting this ?