Configurable subset DestinationRules alongside Flagger's Canary DestinationRules
Describe the feature (What problem are you trying to solve?)
Currently, Flagger overwrites any VirtualService spec information that you may have configured locally when using Istio for routing, based off what the documentation says and what I have tested locally. However, I want to be able to set subset-level traffic splitting for a primary service, and route the rest of the traffic to a legacy service that utilizes Flagger's canary releases.
What I currently would want below:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: rollout-svc
spec:
gateways:
- istio-system/private-gateway
tcp:
- route:
- destination:
host: canary-example
subset: primary
weight: 80 # this part can be overwritten with Flagger to route the rest of the weight here (so for this instance, 80%)
- destination:
host: canary-example
subset: canary
weight: 0
- destination: # this is the part that I want to be able to happen–currently, this is being overwitten
host: alpha-service
subset: alpha-service-dest
weight: 20
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: rollout-destrule
spec:
host: canary-example
subsets:
- name: canary
labels:
app: canary-example
- name: primary
labels:
app: rollout-example
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: alpha-service-dest
spec:
host: alpha-service
subsets:
- name: alpha-service-dest
labels:
app: alpha-service-dest
What my VirtualService gets overwritten to be by Flagger:
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: rollout-svc
spec:
gateways:
- istio-system/private-gateway
tcp:
- route:
- destination:
host: cat-gif-generator-staging-app-primary
weight: 100
- destination:
host: cat-gif-generator-staging-app-canary
weight: 0
Proposed solution (What do you want to happen? Add any considered drawbacks.)
I propose that within the canary.spec section, there is a configurable canary.spec.enableSubset mapping that allows you to have two subsets to route traffic towards! This can let others use Flagger to route a certain amount of traffic to a canary release for testing sake, legacy systems sake, etc., and the rest can go to the primary release area.
Any alternatives you've considered? (Is there another way to solve this problem that isn't as good a solution?)
- I gave some thought to using Flagger's integration of
Istio Delegations, however, I see that we still would not be able to direct traffic with the control / certain weights that we would want to each service
To elaborate further, I think that allowing users of Flagger to have this level of granularity and control over traffic when using subset DestinationRules is a good feature to have so that users can configure there setup to test while still using systems they have configured 🙂 Hopefully this all made sense, I have searched and am still searching currently to see if this issue has been discussed before, but so far I have not encountered any. Cheers!