can we remove leader-elect-resource-lock?

119 views
Skip to first unread message

Aimuz

unread,
Nov 16, 2022, 9:54:56 PM11/16/22
to dev
I have noticed that the current k8s-related programs that need to use LeaderElection all use leases by default

Previously, you could use leader-election-resource-lock as a configuration resource-lock because we didn't have a proprietary resource type to meet the requirements.

Now that k8s seems to provide a leases resource specifically for LeaderElection, can we lock the configuration of leader-elect-resource-lock to leases and not make it configurable?

Jordan Liggitt

unread,
Nov 17, 2022, 8:38:44 AM11/17/22
to mr....@gmail.com, dev
Since 1.24 (in https://github.com/kubernetes/kubernetes/pull/106852), we only support configmapleases, endpointsleases, and leases. configmapleases and endpointsleases are combined resource locks to help migrate from configmaps → leases or endpoints → leases. Dropping support for those would strand consumers of the client-go leader election library currently using a pre-1.24 version with configmaps or endpoints that needed to upgrade to a current version.

We should lock the kubernetes components using leader election (kube-controller-manager, kube-scheduler, cloud-controller-manager, etc) to leases in 1.27. Since we know those components have been built with 1.24, 1.25, etc, we can safely lock them all to use leases at this point.


--
You received this message because you are subscribed to the Google Groups "dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dev+uns...@kubernetes.io.
To view this discussion on the web visit https://groups.google.com/a/kubernetes.io/d/msgid/dev/a56d730f-c6be-499a-ac1e-baf535752810n%40kubernetes.io.

Aimuz

unread,
Nov 17, 2022, 9:47:42 PM11/17/22
to dev, lig...@google.com, dev, Aimuz

So we can first implement locking the kubernetes components component to leases

Do I need to create an issues? Locking kubernetes components using leases

Jordan Liggitt

unread,
Nov 19, 2022, 2:40:21 AM11/19/22
to Aimuz, dev
I think https://github.com/kubernetes/kubernetes/issues/80289 is already open for that, and in 1.27, yes, we can move all kubernetes components to leases unconditionally

Aimuz me

unread,
Nov 21, 2022, 10:58:24 PM11/21/22
to Wojciech Tyczyński, lig...@google.com, dev

I have submitted a PR for locking k8s components to leases.

Please let me know if there are any problems

Wojciech Tyczyński <woj...@google.com> 于2022年11月21日周一 15:13写道:
 As Jordan already wrote - we seem to be ready now for locking core components to leases in 1.27.
This comment: https://github.com/kubernetes/kubernetes/issues/80289#issuecomment-1003969774 is linking the PR where we did the first step - the second step should be fairly similar to that.

Reply all
Reply to author
Forward
0 new messages