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

feat: make LeaseDuration configurable via --leader-election-lease-duration flag #3835

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gjbravi
Copy link

@gjbravi gjbravi commented Sep 3, 2024

Issue

resolves #3823

Description

This PR adds a new flag to the controller, --leader-election-lease-duration will be responsible for externalizing and controlling the LeaseDuration of a Lease owned by aws-load-balancer-controller.

--leader-election-lease-duration defaults to 15s if not informed, matching the default value of a LeaseDuration from controller-runtime.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

Signed-off-by: gjbravi <guilhermejbravi@gmail.com>
Signed-off-by: gjbravi <guilhermejbravi@gmail.com>
Signed-off-by: gjbravi <guilhermejbravi@gmail.com>
Copy link

linux-foundation-easycla bot commented Sep 3, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Sep 3, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @gjbravi!

It looks like this is your first PR to kubernetes-sigs/aws-load-balancer-controller 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/aws-load-balancer-controller has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 3, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @gjbravi. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 3, 2024
@gjbravi
Copy link
Author

gjbravi commented Sep 4, 2024

The AWS LB controller chart version from eks-charts repo points to 1.8.2 as follows:

https://github.com/aws/eks-charts/blob/master/stable/aws-load-balancer-controller/Chart.yaml#L4

While, here is still on 1.7.1:

apiVersion: v2
name: aws-load-balancer-controller
description: AWS Load Balancer Controller Helm chart for Kubernetes
version: 1.7.1
appVersion: v2.7.0

I would really appreciate some guidance on how the chart bump should be made. Ty

@shraddhabang
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 4, 2024
@shraddhabang
Copy link
Collaborator

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 5, 2024
Signed-off-by: gjbravi <guilhermejbravi@gmail.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 6, 2024
@gjbravi
Copy link
Author

gjbravi commented Sep 6, 2024

@shraddhabang thanks for reviewing!

I've also submitted the chart bump on f8c0943 alongside all changes made and the PR labels were removed. Could you please re-check it? Ty

@oliviassss
Copy link
Collaborator

@gjbravi, thanks for the contribution, I left some minor comments, overal LGTM

@shraddhabang
Copy link
Collaborator

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: gjbravi, shraddhabang
Once this PR has been reviewed and has the lgtm label, please assign johngmyers for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

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

@caiofralmeida
Copy link

/lgtm /approve

@shraddhabang the approved label is missing (maybe should be "/approved" ?), could you help us to make this PR mergeable?

@oliviassss
Copy link
Collaborator

@gjbravi, hi sorry for the late response. I have a concern over the specified default duration as 15s, I think it may cause backward compatibility, especially for users who might already specify the duration in their setup. A better option is that we make this flag an opt-in, with no default value, and if it's not specify, the controller should just behave as-is now, this could mitigate the risk to change existing user behavior. Thanks.

@gjbravi
Copy link
Author

gjbravi commented Nov 4, 2024

@oliviassss tks for reviewing.

The current behavior should be equal to the default value brought by controller-runtime as far as I see. Implying that, if not specified in the values file, it will take the default value of 15 seconds.

During the implementation, I've also tested setting a "null" value to the const, however the time pkg does not allow that, forcing me to specify a value(same as the implementation of SyncPeriod).

I can perhaps be missing something here, please let me know in case another solution is also viable here. Tks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Make leaseDurationSeconds of a lease owned by AWS Load Balancer Controller configurable
5 participants