-
Notifications
You must be signed in to change notification settings - Fork 867
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
fix(controller): Sticky session correction for AWS ALB. Fixes #1572 #1577
Conversation
62ef776
to
7bf7b6a
Compare
Codecov Report
@@ Coverage Diff @@
## master #1577 +/- ##
==========================================
+ Coverage 81.97% 82.04% +0.06%
==========================================
Files 116 116
Lines 15929 16099 +170
==========================================
+ Hits 13058 13208 +150
- Misses 2201 2217 +16
- Partials 670 674 +4
Continue to review full report at Codecov.
|
linking #1572 |
rollout/trafficrouting/alb/alb.go
Outdated
@@ -243,6 +243,16 @@ func getForwardActionString(r *v1alpha1.Rollout, port int32, desiredWeight int32 | |||
TargetGroups: targetGroups, | |||
}, | |||
} | |||
|
|||
var stickinessConfig = r.Spec.Strategy.Canary.TrafficRouting.ALB.StickinessConfig | |||
if stickinessConfig.Enabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is default false?
also can you check nil for stickinessConfig ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if stickinessConfig.Enabled { | ||
newStickyConfig := ingressutil.ALBTargetGroupStickinessConfig{ | ||
Enabled: true, | ||
DurationSeconds: stickinessConfig.DurationSeconds, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add validation for stickinessConfig.DurationSeconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harikrongali I'm debating what kind of validation would be reasonable here.
To a certain degree i would the AWS API fail to get its validation result. What did you had in mind here? Verifying that the value is > 0
? Or the same range that is currently employed by the AWS API which is 1-604800 seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same range as specified by AWS API should be good
please add e2e test |
please fix CI failues |
Thank you for the review. Working on this. |
e69ddd8
to
efdabca
Compare
I was wondering how this PR can further proceed? |
@derjust We will review and get this sooner. Meantime, can you rebase to latest as CI checks are failing |
ingress/alb_test.go
Outdated
canaryService := fmt.Sprintf("%s-canary", serviceName) | ||
albActionKey := albActionAnnotation(serviceName) | ||
managedBy := fmt.Sprintf("%s:%s", rollout, albActionKey) | ||
action := fmt.Sprintf(actionTemplate, serviceName, port, canaryService, port) | ||
var template string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we refactor to
if includeStickyConfig {
action := fmt.Sprintf(actionTemplateWithStickyConfig, serviceName, port, canaryService, port)
}
managedByValue := fmt.Sprintf("%s:%s", managedBy, albActionAnnotation(stableSvc)) | ||
action := fmt.Sprintf(actionTemplate, canarySvc, port, weight, stableSvc, port, 100-weight) | ||
var action string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor to
action := fmt.Sprintf(actionTemplate, canarySvc, port, weight, stableSvc, port, 100-weight)
if includeStickyConfig {
action = fmt.Sprintf(actionTemplateWithStickyConfig, canarySvc, port, weight, stableSvc, port, 100-weight)
}
@derjust overall looks good. Thanks for the contribution. As soon as the comments & CI failures are fixed, I will get this merged |
Please run codegen locally and commit changes generated from it. |
Thank you for the extensive review - it's my first Go PR so I appreciate all the effort. |
97e5bb2
to
55791d4
Compare
@derjust there are some unit tests failing with nil pointer exceptions.
can you run "make test" locally? |
@derjust please do steps mentioned in for DCO Check https://github.com/argoproj/argo-rollouts/pull/1577/checks?check_run_id=4268869529 |
7b26322
to
5e40c54
Compare
@@ -1,3 +1,4 @@ | |||
//go:build !ignore_autogenerated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code-gen failing for this line. please remove this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you; undone.
Does the code-gen
has an issue running on Mac?
5e40c54
to
3db8036
Compare
Unit tests work locally (Note: they fail on OSX with a |
@derjust seems the code-gen that you are running has issues https://github.com/argoproj/argo-rollouts/runs/4303557116?check_suite_focus=true . can you let me know if you followed https://argoproj.github.io/argo-rollouts/CONTRIBUTING/
|
@harikrongali thank you for your continued help.
To help it i force-use GoLang 1.16 - for some reason
|
48b3d4f
to
3218bfa
Compare
Did more investigation and posted my findings around my codegen issue - and failing e2e test - as new issue: Hope this can shed some light? |
Signed-off-by: Alexander Matyushentsev <[email protected]>
Adds support for AWS ALB [TargetGroupStickinessConfig](https://aws.amazon.com/blogs/aws/new-application-load-balancer-simplifies-deployment-with-weighted-target-groups/) This is required to support sticky session on the listener level while Argo is using ALB's weighting Signed-off-by: Sebastian J <[email protected]>
Signed-off-by: Sebastian J <[email protected]>
Signed-off-by: Sebastian J <[email protected]>
Signed-off-by: Sebastian J <[email protected]>
Signed-off-by: Sebastian J <[email protected]>
Signed-off-by: Sebastian J <[email protected]>
Forced codegen via downgrading to Go 1.16: ``` $ env|grep GO GOPATH=/Users/sebastian/go ``` ``` $ go version go version go1.16.10 darwin/amd64 ``` ``` $ echo $PATH /Users/sebastian/.sdkman/candidates/micronaut/current/bin:/Users/sebastian/.sdkman/candidates/java/current/bin:/Users/sebastian/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/MacGPG2/bin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/bin:/Users/sebastian/go/bin ``` Signed-off-by: Sebastian J <[email protected]>
A PR for the issue in #1675 was provided. |
3218bfa
to
97bc370
Compare
Signed-off-by: Sebastian J <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@derjust sorry, I am out the last couple of weeks. I will get this merged this week. |
@alexmt can you merge the PR. e2e test failed is a flaky one not related the current change. |
When sticky sessions are activated on the Ingress for AWS ALB:
also targetGroup stickiness must be configured.
Otherwise the error
is reported by the AWS ALB.
Therefore this PR adds support for AWS ALB TargetGroupStickinessConfig following the same pattern as the
additionalIngressAnnotations
for Istio on the Rollout:Checklist:
"fix(controller): Updates such and such. Fixes #1234"
.