Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding support for defining max destination weights in Istio VS #1420

Closed
wants to merge 1 commit into from

Conversation

agrawroh
Copy link
Member

@agrawroh agrawroh commented Aug 14, 2021

Change Description

This PR adds the support for defining an optional max weight for the destinations in Istio VirtualService. If the maxWeight parameter is defined and has a valid value i.e. 0 < maxWeight <= 100 then it'll be used as an upper bound for the traffic sent to stable service + canary service.

The use cases for defining maxWeight includes:

  • Having another set of fixed destination(s) which the user doesn't want to be affected during the Argo Rollouts (For example, a legacy service).

Signed-off-by: Rohit Agrawal [email protected]

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

@sonarcloud
Copy link

sonarcloud bot commented Aug 14, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.1% 0.1% Duplication

@codecov
Copy link

codecov bot commented Aug 14, 2021

Codecov Report

Merging #1420 (efe7fc2) into master (53b1996) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1420      +/-   ##
==========================================
+ Coverage   81.37%   81.39%   +0.02%     
==========================================
  Files         108      108              
  Lines       10038    10052      +14     
==========================================
+ Hits         8168     8182      +14     
  Misses       1313     1313              
  Partials      557      557              
Impacted Files Coverage Δ
rollout/trafficrouting/istio/istio.go 82.35% <100.00%> (+0.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53b1996...efe7fc2. Read the comment docs.

Copy link
Member

@huikang huikang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -368,6 +368,8 @@ type IstioTrafficRouting struct {
VirtualService IstioVirtualService `json:"virtualService" protobuf:"bytes,1,opt,name=virtualService"`
// DestinationRule references an Istio DestinationRule to modify to shape traffic
DestinationRule *IstioDestinationRule `json:"destinationRule,omitempty" protobuf:"bytes,2,opt,name=destinationRule"`
// Max weight that will be split between canary and stable services. If unset, it defaults to 100.
MaxWeight int64 `json:"maxWeight,omitempty" protobuf:"bytes,3,opt,name=maxWeight"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing // +optional

@@ -33,6 +33,8 @@ spec:
virtualService:
# Reference to a VirtualService which the controller updates with canary weights
name: rollouts-demo-vsvc
# Optional if there are only two destinations in your routes or if you want to split 100% traffic between stable and canary services. If specified, this will be used as an upper bound for traffic between canary + stable services.
maxWeight: 80
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like we are overusing the example in the getting-started page. Can we move this advanced use to https://argoproj.github.io/argo-rollouts/features/traffic-management/istio/ and leave the getting-started example straightfoward. Thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. Will update!

@@ -33,6 +33,8 @@ spec:
virtualService:
# Reference to a VirtualService which the controller updates with canary weights
name: rollouts-demo-vsvc
# Optional if there are only two destinations in your routes or if you want to split 100% traffic between stable and canary services. If specified, this will be used as an upper bound for traffic between canary + stable services.
maxWeight: 80
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds maxWeight prop at the level of the virtualService, therefore it will affect all the routes ArgoRollouts manage - which are specified in strategy.canary.trafficRouting.istio.virtualService.routes

While in our use case we'd want only specific routes to have less then 100 weight managed by ArgoRollouts.
Our Virtual Service has such routes

  • a route for the traffic originating in Mesh. Here we want e.g. 80% to be split between stable and canary in Mesh, and 20% to go to the legacy system.
  • a route for the traffic coming to Mesh Ingress Gateway from the Legacy system. Here we want 100% to be split between stable and canary in Mesh. (we don't want to bounce the traffic back to the legacy)

What do you think?

(maybe we can move the maxWeight to the level of the strategy.canary.trafficRouting.istio.virtualService.routes. Or remove maxWeight and configure ArgoRollouts to manage only the first 2 destinations in founds in a route...)

Copy link
Member Author

@agrawroh agrawroh Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no straightforward way to do it at the per-route level. Currently, routes is nothing but an array of strings which take the HTTP route names. For us to do it at the route-level, we need a struct/object similar to what we have for tlsRoutes where we can add an optional maxWeight prop.

One proposal is to add an optional httpRoutes which will be an array of objects similar to the tlsRoutes and gradually deprecate the use of routes over time. In the beginning, we can enforce the use of only one i.e either routes or httpRoutes. I proposed this to @jessesuen as well.

@jessesuen @huikang Any suggestions on what would be the best way to move forward here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @agrawroh, I am interested in coming up with a solution for this as well. I would like to reopen this PR or something similar to support this feature.

@jessesuen @huikang are there any suggestions for moving forward ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dnguy078 Sure, that'd be great. Please feel free to take it over or let me know how I can help.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @agrawroh I am trying to solve an issue related to istio subset level in another PR as well. #3126 I was wondering if you could take a quick look :)

Copy link

@bakayolo bakayolo Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dnguy078 any update? This is a pretty big blocker for argo-rollouts adoption on our end.

Also note that even though this PR was not addressing this exact issue, it would have been incredibly helpful for single route virtual service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants