-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Refactor status update #3885
Refactor status update #3885
Conversation
/hold |
8dbe9a9
to
036e355
Compare
How is this fixing #2773? https://github.com/kubernetes/ingress-nginx/pull/3885/files#diff-cde3fffe2425ad7efaa8add1d05ae2c0R286 will only clean up hosts, but how are you making sure metric collector will not keep emitting |
Last commit |
5fb0a84
to
924d5c9
Compare
/hold |
Codecov Report
@@ Coverage Diff @@
## master #3885 +/- ##
==========================================
- Coverage 55.05% 54.33% -0.73%
==========================================
Files 82 83 +1
Lines 6121 6151 +30
==========================================
- Hits 3370 3342 -28
- Misses 2362 2427 +65
+ Partials 389 382 -7
Continue to review full report at Codecov.
|
@ElvinEfendi ready for another review |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, ElvinEfendi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
// if there is no other instances running. | ||
func (s statusSync) Shutdown() { | ||
go s.syncQueue.Shutdown() | ||
|
||
// remove IP from Ingress | ||
if s.elector != nil && !s.elector.IsLeader() { |
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.
@aledbf - do you know why this code was removed. we are running into a regression where during rolling update the ingress status is getting removed by the last pod of old deployment and we are suspecting this is the issue here.
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.
@rajatjindal because we now use a callback https://github.com/kubernetes/ingress-nginx/pull/3885/files#diff-7d2578dc5d43f0b395d7cd3312c5c489R63
the ingress status is getting removed by the last pod of old deployment and we are suspecting this is the issue here.
This is expected. If you don't want this behavior you need to set UpdateStatusOnShutdown=false (flag --update-status-on-shutdown
)
What this PR does / why we need it:
This PR extracts the leader election code from the status package to be able to use such a feature at the controller level for other operations.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged):fixes #3565
fixes #2773
Special notes for your reviewer: