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

Allow to pass a custom resourcelock.Interface for leader election #2026

Closed
johscheuer opened this issue Oct 19, 2022 · 2 comments · Fixed by #2027
Closed

Allow to pass a custom resourcelock.Interface for leader election #2026

johscheuer opened this issue Oct 19, 2022 · 2 comments · Fixed by #2027

Comments

@johscheuer
Copy link
Contributor

The current controller-runtime supports some customisation for the leader election by providing/setting the according LeaderElection.. options. It would be nice if a user could provide their own resourcelock.Interface to be more flexible and allow the user to create different customisations of resourcelock.Interface that are currently not supported.

@alvaroaleman
Copy link
Member

Could you expand on what your use case is/What you want to to configure that you can't and why?

@johscheuer
Copy link
Contributor Author

johscheuer commented Oct 20, 2022

Sure the https://pkg.go.dev/k8s.io/client-go/tools/leaderelection/resourcelock#MultiLock supports to provide two Interfaces and it's mostly used for a transition path e.g. when using configmaps and leases at the same time but you can also use that mechanism to get a lease in two different Kubernetes clusters e.g. if you run an operator across multiple Kubernetes clusters. Another benefit would be that this change allows to implement a custom Interface that e.g. uses something else than Kubernetes as a lease mechanism. The current implementation will always use the same config, so it's not possible to configure a MultiLock across two Kubernetes clusters in the controller-runtime.

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 a pull request may close this issue.

2 participants