flagger
flagger copied to clipboard
Add response header on a per destination basis
I'm trying to define add a http response header to a request only when it is routed through my -canary
service.
I'm using Istio.
I found I can add this to my Canary object
headers:
response:
add:
x-is-canary: "true"
but this adds it to all the route
s of my VirtualService
http:
- headers:
response:
add:
x-is-canary: 'true'
match:
- headers:
canarymvp:
regex: custom
route:
- destination:
host: canarymvp-primary
weight: 0
- destination:
host: canarymvp-canary
weight: 100
- headers:
response:
add:
x-is-canary: 'true'
route:
- destination:
host: canarymvp-primary
weight: 0
I want this header to only exist on requests going to my canarymvp-canary
Service
- destination:
host: canarymvp-canary
headers:
response:
add:
x-is-canary: 'true'
👍 any solution? (can the canary vs primary legs of the VS flagger creates be customized, something like
a service-primary:
and a service-secondary:
section that can be customized in canary.yaml
I guess the alternative is delegation?)