-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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 endpoints controller del lead-election endpoints #45478
fix endpoints controller del lead-election endpoints #45478
Conversation
what's wrong with CI, it shows
but the import seems no error
|
Please run |
I don't have enough context, @wojtek-t do you mind taking a look? |
I think this PR is fine, but adding @mikedanese for final confirmation. |
85b480e
to
e7ea942
Compare
Yes I update it now |
This is a fine solution but I will propose an alternative. The leader election client could create a headless service without a selector for the corresponding endpoints if that service does not exist. Cluster operators can later modify this service to select the corresponding pods which seems desirable. |
That's also OK, the good points of this solution is avoiding endpoints-controller know anything about leader-election, the bad points is that user maybe confused by 2 not working Services. maybe you can add some description in these lead-election Services. |
We might want to consider the other approach. For now this is fine. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HardySimpson, mikedanese
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Fixes #45585 |
Automatic merge from submit-queue (batch tested with PRs 45569, 45602, 45604, 45478, 45550) |
Any chance of a 1.6 cherry pick? |
@@ -461,6 +462,14 @@ func (e *EndpointController) checkLeftoverEndpoints() { | |||
} | |||
for i := range list.Items { | |||
ep := &list.Items[i] | |||
if _, ok := ep.Annotations[resourcelock.LeaderElectionRecordAnnotationKey]; ok { |
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.
this seems inappropriate... I would have expected an empty service definition rather than changing the endpoints controller (as long as an endpoints object was still being used as a lock object... the move to configmaps makes this less relevant)
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.
We discussed that here #45478 (comment), I prefer it as well. Happy to switch that over.
when there are multiple controller-manager instances, we observe that it will delete leader-election endpoints after 5min, and cause re-election, add a check to avoid that
Fixes #45585
error log
release-note