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

Update module sigs.k8s.io/controller-runtime to v0.12.0 #5662

Merged
merged 5 commits into from May 18, 2022

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 11, 2022

WhiteSource Renovate

This PR contains the following updates:

Package Type Update Change
sigs.k8s.io/controller-runtime require minor v0.11.2 -> v0.12.1

Configuration

πŸ“… Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

β™» Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox. ⚠ Warning: custom changes will be lost.

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot added the >renovate PRs created by or relating to Renovate label May 11, 2022
@thbkrkr thbkrkr self-assigned this May 12, 2022
@thbkrkr
Copy link
Contributor

thbkrkr commented May 16, 2022

Breaking change:

See kubernetes/kubernetes#107454 for migration steps.

06360dd puts the operator in version x+1: use configmapsleases for leader election, this client will use both configmaps and lease objects, so that new (x+1) client can work with old (x) clients.

74fcaa5 adds the RBAC permissions for coordination.v1/lease.

@thbkrkr
Copy link
Contributor

thbkrkr commented May 16, 2022

@elasticmachine run elasticsearch-ci/docs

@thbkrkr thbkrkr requested review from naemono, pebrc and barkbay May 16, 2022 14:11
@naemono
Copy link
Contributor

naemono commented May 16, 2022

Any reason not to use Leases, which are the default now?

diff --git a/cmd/manager/main.go b/cmd/manager/main.go
index d12486242..9ea48643b 100644
--- a/cmd/manager/main.go
+++ b/cmd/manager/main.go
@@ -474,7 +474,7 @@ func startOperator(ctx context.Context) error {
                Scheme:                     clientgoscheme.Scheme,
                CertDir:                    viper.GetString(operator.WebhookCertDirFlag),
                LeaderElection:             viper.GetBool(operator.EnableLeaderElection),
-               LeaderElectionResourceLock: resourcelock.ConfigMapsResourceLock, // TODO: Revert to ConfigMapsLeases when support for 1.13 is dropped
+               LeaderElectionResourceLock: resourcelock.LeasesResourceLock,

Also likely need to test an upgrade to this version to ensure things transition smoothly with the locks...

@thbkrkr
Copy link
Contributor

thbkrkr commented May 18, 2022

Any reason not to use Leases, which are the default now?

This is to provide at least one version of the operator with the transitional type of resource lock configmapsleases that offers a smooth migration path. I did some testing with only Lease with 10 replicas for the operator StatefulSet and I could observe two different operator pods in two different versions reconciling Elastic resource in //.

This can be a real problem depending on the version you are upgrading from. Currently, all operator versions only use configmaps. If you upgrade from a relatively old version of the operator, which means that "some things have changed" since then, to the lease version, you may find yourself in a situation where the two operators are fighting to reconcile resources, which can disrupt your Elastic resources if you don't have HA configurations.

This make me think that we may want to retain the intermediate type of lock (configmapsleases) for more than one version of the operator, if we want to maximize the number of users who will do the migration properly, as we cannot be sure that all of our users will upgrade to the next version. We could look at telemetry to help (e.g.: 95% of the users will install one of the next 3 versions.)

Copy link
Contributor

@naemono naemono left a comment

Choose a reason for hiding this comment

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

makes perfect sense @thbkrkr thanks!

@thbkrkr thbkrkr merged commit 3e2350a into main May 18, 2022
@thbkrkr thbkrkr added the v2.3.0 label May 18, 2022
@thbkrkr thbkrkr deleted the renovate/sigs.k8s.io-controller-runtime-0.x branch May 24, 2022 15:23
@thbkrkr thbkrkr added the exclude-from-release-notes Exclude this PR from appearing in the release notes label Jun 7, 2022
fantapsody pushed a commit to fantapsody/cloud-on-k8s that referenced this pull request Feb 7, 2023
* Update module sigs.k8s.io/controller-runtime to v0.12.0
* Run generate
* Update Agent template hash in TestReconcileAgent_Reconcile
* Use configmapsleases for leader election
* RBAC permissions for coordination.v1/lease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude-from-release-notes Exclude this PR from appearing in the release notes >renovate PRs created by or relating to Renovate v2.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants