fluxcd/flagger

Multiple canaries for the same deployment

shysank opened this issue · 1 comments

Describe the feature

Multiple canaries for the same deployment. Example

apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
  name: my-service-canary1
spec:
  analysis:
    ...
  service:
    gateways:
      - gateway1
    hosts:
      - example.net
  targetRef:
    kind: Deployment
    name: my-service
  http:
    - match:
        - uri:
            prefix: /my-service

apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
  name: my-service-canary2
spec:
  analysis:
    ...
  service:
    gateways:
      - gateway2
    hosts:
      - example.com
  targetRef:
    kind: Deployment
    name: my-service
  http:
    - match:
        - uri:
            prefix: /some-prefix/my-service

apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
  name: my-service-canary3
spec:
  analysis:
    ...
  service:
    gateways:
      - gateway3
    hosts:
      - my-service.net
  targetRef:
    kind: Deployment
    name: my-service
  http:
    - match:
        - uri:
            prefix: /

What problem are you trying to solve?

We want to expose the service in multiple gateways with different paths. Something like

example.net/my-service/
example.com/someprefix/my-service
my-service.net/

Is this this supported in flagger? Also, is this the right way to do it or is there a better way to achieve the same result.

Some options we explored

  1. Use specific hosts/gateways for a http match.
  2. Use delegate virtual service

In both the options, we couldn't find a way to have multiple rewrite rules and header customizations. This is because flagger only updates a single http route during canary analysis.

Any thoughts @stefanprodan