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

Set leader election deadline to 30s #239

Merged
merged 4 commits into from
Mar 25, 2021
Merged

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Mar 23, 2021

This PR allows fine tuning the leader election with cmd args:

--enable-leader-election=true
--leader-election-release-on-cancel=true
--leader-election-lease-duration=35s
--leader-election-renew-deadline=30s
--leader-election-retry-period=5s

To make the leader election more tolerant to transient Kubernetes API outages, the renewal deadline was increased from 10s to 30s and the retry interval was bumped to 5 seconds.

Test image:

docker.io/stefanprodan/helm-controller:le-config-b74081d

Part of: fluxcd/pkg#94

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan changed the title Add leader election deadline to cmd args Set leader election deadline to 30s Mar 25, 2021
@stefanprodan stefanprodan marked this pull request as ready for review March 25, 2021 10:57
@stefanprodan stefanprodan added the enhancement New feature or request label Mar 25, 2021
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Tested various disruptions on a Kubernetes v1.20.4 "production" cluster without any issues. Thanks @stefanprodan 💯

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
main.go Outdated Show resolved Hide resolved
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Excellent use of a value that was already present 💯

@stefanprodan stefanprodan merged commit c2b3848 into main Mar 25, 2021
@stefanprodan stefanprodan deleted the leader-election-config branch March 25, 2021 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants