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

add support Lease-based leader election (rather than ConfigMaps) #1877

Open
thesuperzapper opened this issue Aug 12, 2022 · 12 comments · May be fixed by #2314
Open

add support Lease-based leader election (rather than ConfigMaps) #1877

thesuperzapper opened this issue Aug 12, 2022 · 12 comments · May be fixed by #2314
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@thesuperzapper
Copy link

What is the feature and why do you need it:

Currently, the K8S Python API only supports leader election using ConfigMapLock.

The K8S Go API supports using the proper Lease resource type with its LeaseLock, and actually recently removed support for the legacy ConfigMap approach.

We should update the Kubernetes Python API to provide a Lease-based leader election.


/cc @Invictus17 @tdihp

@thesuperzapper thesuperzapper added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 12, 2022
@roycaihw
Copy link
Member

/help

@k8s-ci-robot
Copy link
Contributor

@roycaihw:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

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.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Aug 15, 2022
@Jagrutiti
Copy link

Hi,

I am beginner to Kuberenetes repo. Do you think this is a good issue to pick?

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 8, 2023
@thesuperzapper
Copy link
Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 8, 2023
@edas-smith
Copy link

+1 for this - Would be great to have this

@lwille
Copy link

lwille commented Jul 25, 2024

Adding my +1 to prevent this from becoming stale.

@rvlane
Copy link

rvlane commented Oct 9, 2024

Came across this researching providing HA on an operator based solution and wanted to have this Lease-base lock implemented. Got a fork setup through my company and plan to contribute this back to the project. Just need to know the process for contributing this back. Thanks

@Invictus17
Copy link
Contributor

@rvlane you can send a PR similar to https://github.com/kubernetes-client/python/pull/1747/commits. Hope that helps. I can review it.

cc: @roycaihw

@rvlane
Copy link

rvlane commented Dec 16, 2024

@Invictus17 Thanks. Starting work on this now.

@rvlane
Copy link

rvlane commented Dec 17, 2024

@Invictus17 Implementation question:
Currently the LeaderElectionRecord saves the string representation of the times and lease_duration. I woiuld prefer to change this to save the raw datetime object and let ConfigMapLock and the new LeaseLock decode as needed since currently ConfigMapLock saves to the annotation in string format and the isoformat is required by the V1Lease object. Reluctant to do this in case anyone is using the LeaderElectioniRecord itself. So question is: Can I change LeaderElectionRecord to store raw objects instead of string representations? Otherwise, if need to keep this record structure in tact, will convert from string to object, then to isoformat for the V1Lease. Thanks.

cc: @roycaihw

rvlane added a commit to nokia/kubernetes-client-python that referenced this issue Dec 17, 2024
@rvlane
Copy link

rvlane commented Dec 17, 2024

@Invictus17 Pull request created: #2314

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
9 participants