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

⚠ leaderelection: use 'leases' as default resource lock object #1773

Conversation

joelanford
Copy link
Member

@joelanford joelanford commented Jan 11, 2022

Update the default resource lock from configmapsleases to leases.

The previous default (since v0.7.0) was configmapsleases, which is the migration step from configmaps to leases. Since the default was configmapsleases for over a year, spanning five minor releases, any actively maintained operators are very likely to have a released version that uses configmapsleases. Therefore defaulting to leases now should be safe.

Any operators currently on a version <0.7.0 should migrate from configmaps to leases via configmapsleases.

  • If an operator is currently on version <v0.7.0, it is hardcoded to using configmaps
  • If an operator is currently in the range v0.7.0 to a version prior to this PR merging, it is configurable, but defaulted to configmapsleases.
  • If an operator is using a version of controller-runtime containing this PR, it is configurable but defaulted to leases.

Operators currently using configmaps should:

  1. Release a version (A) of their operator that uses controller-runtime v0.7.0+ (if jumping directly to a version of controller-runtime containing this PR, you should explicitly set configmapsleases when configuring leader election in this version)
  2. Release a subsequent version (B) of their operator that uses a version of controller-runtime containing this PR (or if not bumping, you should explicitly set leases when configuring leader election in this version)
  3. Ensure operators upgrade through A before getting to B.

See kubernetes/kubernetes#107454 (This PR moves controller-runtime from step x+1 to x+2)

Signed-off-by: Joe Lanford joe.lanford@gmail.com

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 11, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 11, 2022
@joelanford joelanford force-pushed the feat/leader-election-use-leases-only branch from 4f4d30e to d2c2839 Compare January 11, 2022 20:48
@joelanford
Copy link
Member Author

/test pull-controller-runtime-test-master

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
@joelanford joelanford force-pushed the feat/leader-election-use-leases-only branch from d2c2839 to 6c4d947 Compare January 11, 2022 21:34
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 11, 2022
@joelanford
Copy link
Member Author

/test pull-controller-runtime-test-master

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 19, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joelanford, vincepri

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:
  • OWNERS [joelanford,vincepri]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 7ba3e55 into kubernetes-sigs:master Jan 19, 2022
@k8s-ci-robot k8s-ci-robot added this to the v0.10.x milestone Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants