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: Wait for canary RS to have ready replicas before shifting labels #1022

Merged
merged 3 commits into from
Mar 9, 2021

Conversation

aweis89
Copy link
Contributor

@aweis89 aweis89 commented Mar 3, 2021

feat: Wait for first batch of new RS pods to be ready before adding canary selector label to an SVC. Fixes #1026

  • Last commit does a bit of extra refactoring for the reconcileStableAndCanaryService function (can easily be reversed if not desirable).
    • Moves a bit of duplicated logic, previously executed for both canary and stable SVCs and RSs, into it's own function ensureSVCTargets.
  • Adds a new function newRSReady which needs to return true before the canary SVC gets the newRS selector label.
    • The newRS needs to exist, not have ReadyReplicas < Replicas and not have 0 ReadyReplicas, thereby ensuring the first batch of Pods are ready before targeting the newRS.

(Was also considering perhaps making this label addition an optional step so when specified, the user can control precisely when the label swap happens.)

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.

@aweis89 aweis89 force-pushed the fix-premature-canary-svc-labels branch 2 times, most recently from aa2c4c5 to 6028f3c Compare March 5, 2021 00:04
@codecov-io
Copy link

codecov-io commented Mar 5, 2021

Codecov Report

Merging #1022 (76d65cb) into master (6f501f7) will increase coverage by 0.03%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1022      +/-   ##
==========================================
+ Coverage   80.90%   80.93%   +0.03%     
==========================================
  Files         102      102              
  Lines        9080     9086       +6     
==========================================
+ Hits         7346     7354       +8     
+ Misses       1240     1239       -1     
+ Partials      494      493       -1     
Impacted Files Coverage Δ
rollout/service.go 78.94% <77.77%> (+4.66%) ⬆️

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 6f501f7...76d65cb. Read the comment docs.

@aweis89 aweis89 force-pushed the fix-premature-canary-svc-labels branch from 6028f3c to 07f9d02 Compare March 5, 2021 00:10
@aweis89 aweis89 changed the title Wait for canary RS to have ready replicas before shifting labels feat: Wait for canary RS to have ready replicas before shifting labels Mar 5, 2021
@aweis89 aweis89 force-pushed the fix-premature-canary-svc-labels branch 3 times, most recently from e810e85 to 5502336 Compare March 5, 2021 19:53
@aweis89 aweis89 force-pushed the fix-premature-canary-svc-labels branch 3 times, most recently from 66290ab to e554327 Compare March 5, 2021 21:00
Signed-off-by: Aaron Weisberg <[email protected]>
@aweis89 aweis89 force-pushed the fix-premature-canary-svc-labels branch 3 times, most recently from c62a9e8 to 76d65cb Compare March 8, 2021 03:11
Signed-off-by: Aaron Weisberg <[email protected]>
@aweis89 aweis89 force-pushed the fix-premature-canary-svc-labels branch from 76d65cb to 2482041 Compare March 8, 2021 16:48
@sonarcloud
Copy link

sonarcloud bot commented Mar 8, 2021

Kudos, SonarCloud Quality Gate passed!

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@jessesuen jessesuen left a comment

Choose a reason for hiding this comment

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

Great improvement!

@jessesuen jessesuen merged commit 47d66bf into argoproj:master Mar 9, 2021
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.

Canary SVC shouldn't target the new RS until first batch of canary Pods are ready
3 participants