-
Notifications
You must be signed in to change notification settings - Fork 1.2k
✨Add option to use Lease lock if coordination group is available #600
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
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mszostok The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5e26c0e
to
fea2ea9
Compare
I've checked the #444 and there is no merge conflict because the logic that I'm adding in this PR is directly in one thing that needs to be changed are comments:
we should remove the information about the
If we agree on that then on #444 it should be adjusted too /cc @DirectXMan12 |
8efda4e
to
13fe693
Compare
- Choose the Lease lock if lease.coordination.k8s.io is available otherwise, use ConfigMaps. - Add tests coverage for implemented logic using ginko & gomega - Remove outdated information about cert generation
13fe693
to
179f36f
Compare
I had to rebase after merging #591 |
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.
Should this be configurable?
Should we try pass in the RESTMapper instead of adding yet another call to discovery?
@DirectXMan12 thanks for comments, please check my answers
tbh I didn’t take this into account because this is only one call to api-server and only at the beginning. Using client allows us to encapsulate new logic inside the if you think that it's a better approach then I will rewrite the current proposition and change test coverage.
Good question, in the #460 task there was only info that new API should be used when available and fall back to configmaps if not, so I didn't customize that What kind of customization level you were thinking about?
one thing that comes to my mind which I want to clarify. This impl will be a little "breaking change", right? Scenario 1: Scenario 2:
Both will work at the same time (reconcile process). Because the old one will check the ConfigMap and the new one will check the Lease. So user needs to know controller Deployment should have the Recreate strategy to prevent such a situation. So what about the migration path? Should it be automated? Documented? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@mszostok: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@mszostok: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Fix some phrases in what_is_a_controller.md
cc @JoelSpeed (not sure how active you want to be anymore -- lmk if you don't want to be tagged), @GrigoriyMikhalkin, @alvaroaleman (all of whom have had thoughts on LE in the past) |
This seems sensible to me, glad someone's gotten around to doing this! What happens during rolling updates when changing from the |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Is this PR still relevant? Can it be merged? |
As Joel mentioned, we need to think about how we migrate existing controllers that currently use a configmap |
I understand, but meantime this option can be used by those who do not need to migrate. |
Unfortunately not, because with the changes in this PR controllers will automatically use the lease lock if its available. This means that if a controller gets updated to this version of c-r and then deployed, there are two replicas that use a different mechanism for leader election which means they can hold a leader lock simultaneously. This means we very silently break valid expectations ("If I enable leader election, there will always at most be one active replica") and that is not an option. Someone has to come up with a concept for what we can do to prevent that. Possible approaches include:
|
I think it's a reasonable approach to stick with configmap as default and provide an option to change to lease. |
Yeah, generally that sounds reasonable. It is subpar insofar that we basically say the recommended leader lock is not the default one due to these compatibility concerns but I guess its the best we can do and we can add a TODO to the manager to change the default when we break its interface. |
Sounds good for me. |
So, can we reopen this PR or do we need a new one? |
Well, the PR got closed due to staleness which seems to indicate that the
original author doesn't have the cycles to finish this up so opening a new
PR may make sense.
…On Sun, May 17, 2020 at 6:26 AM Leonid Gorelik ***@***.***> wrote:
So, can we reopen this PR or do we need a new one?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#600 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRR6ZBWUKBRZBDWDT4FTRDRR63U3ANCNFSM4IVXBN4Q>
.
|
Description
NewResourceLock
method: Choose the Lease lock iflease.coordination.k8s.io
is available otherwise, use ConfigMaps.Notes to reviewer:
NewResourceLock
method is not easily testable. To do it you need to hack it via injected rest config. I did it in a similar way as in kubectl pkg.table tests
, see this: https://gist.github.com/mszostok/11278dbc9316d526cd8a2e09f063e50fbut IMO is not worth it.
Fixes: #460
needs to be sync with #444