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

Fix initial deployment downtime #1451

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

miguelvalerio
Copy link
Contributor

@miguelvalerio miguelvalerio commented Jul 2, 2023

Fixes #1444.

After taking a look at the code, I think the current implementation could cause some issues: considering that if might be a bit of latency between scaling de Deployment/DaemonSet to 0 and updating the Service, the Service would be left with no Pods to communicate to for a bit. This would be even worse if, for some reason, updating the Service failed, leaving the apex service with no Pods for even longer.

This solution moves the ScaleToZero to be performed only after the apex service is already pointing to the primary target, and should therefore mitigate the issues described above.

@miguelvalerio miguelvalerio marked this pull request as ready for review July 2, 2023 16:27
@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2023

Codecov Report

Patch coverage: 42.85% and project coverage change: +0.03% 🎉

Comparison is base (2944581) 54.53% compared to head (b25e12d) 54.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1451      +/-   ##
==========================================
+ Coverage   54.53%   54.56%   +0.03%     
==========================================
  Files          84       84              
  Lines       10146    10143       -3     
==========================================
+ Hits         5533     5535       +2     
+ Misses       3956     3953       -3     
+ Partials      657      655       -2     
Files Changed Coverage Δ
pkg/canary/daemonset_controller.go 57.52% <ø> (+0.37%) ⬆️
pkg/canary/deployment_controller.go 44.38% <ø> (+0.05%) ⬆️
pkg/controller/scheduler.go 45.30% <42.85%> (-0.03%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@aryan9600 aryan9600 left a comment

Choose a reason for hiding this comment

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

left a couple of nits, but apart from that its looking good!

pkg/controller/scheduler.go Outdated Show resolved Hide resolved
pkg/canary/deployment_controller.go Outdated Show resolved Hide resolved
pkg/canary/daemonset_controller.go Outdated Show resolved Hide resolved
@aryan9600
Copy link
Member

could you these commits into one commit and make sure you rebase against main? we should be ready to merge then :)

@miguelvalerio
Copy link
Contributor Author

should be good now, thanks :)

Copy link
Member

@aryan9600 aryan9600 left a comment

Choose a reason for hiding this comment

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

lgtm! thanks @miguelvalerio 🙇

Signed-off-by: miguelvalerio <miguelgomes.valerio@gmail.com>
@aryan9600 aryan9600 merged commit ba7fedf into fluxcd:main Aug 18, 2023
17 checks passed
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.

Migrating from Deployment to Canary causes downtime
3 participants