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

✨LeaderElection configuration as flags #2664

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

trutx
Copy link
Contributor

@trutx trutx commented Mar 13, 2020

What this PR does / why we need it:

Enables setting manager LeaderElection options via command line flags

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Fixes #2653

I just implemented the optional settings in these two files but there's 3 other files where they could be implemented as well:

https://github.com/kubernetes-sigs/cluster-api/blob/master/controlplane/kubeadm/main.go
https://github.com/kubernetes-sigs/cluster-api/blob/master/test/infrastructure/docker/main.go
https://github.com/kubernetes-sigs/cluster-api/blob/master/cmd/example-provider/main.go

Do you think it makes sense to add the flags there too?

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 13, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @trutx. 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 13, 2020
@detiber
Copy link
Member

detiber commented Mar 13, 2020

I just implemented the optional settings in these two files but there's 3 other files where they could be implemented as well:

https://github.com/kubernetes-sigs/cluster-api/blob/master/controlplane/kubeadm/main.go

Yes, I think we'd want to expose it for the KubeadmControlPlane controller manager as well

https://github.com/kubernetes-sigs/cluster-api/blob/master/test/infrastructure/docker/main.go

Since the docker provider is mainly used for testing, I don't think there is any need to expose leader election configuration.

https://github.com/kubernetes-sigs/cluster-api/blob/master/cmd/example-provider/main.go

Same thing here, this provider should only be used during testing, so no need to expose leader election config here.

@detiber
Copy link
Member

detiber commented Mar 13, 2020

/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 Mar 13, 2020
bootstrap/kubeadm/main.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 13, 2020
@chuckha
Copy link
Contributor

chuckha commented Mar 17, 2020

/assign

Copy link
Contributor

@chuckha chuckha left a comment

Choose a reason for hiding this comment

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

There are improvements discussed in the previous reviews that can be targeted as an add-on. Would you be able to file an issue for consolidating some kind of controller-runtime flag library we could share across controllers? Otherwise, one comment on the flag description and the rest lgtm

bootstrap/kubeadm/main.go Outdated Show resolved Hide resolved
@vincepri
Copy link
Member

/milestone v0.3.2

@k8s-ci-robot k8s-ci-robot added this to the v0.3.2 milestone Mar 17, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

We'll also need an issue in CAPA and CAPV that adds these flags there as well. I'd be also helpful to add it to this document https://master.cluster-api.sigs.k8s.io/developer/providers/v1alpha2-to-v1alpha3.html for providers to implement in the same way

bootstrap/kubeadm/main.go Outdated Show resolved Hide resolved
bootstrap/kubeadm/main.go Outdated Show resolved Hide resolved
@vincepri
Copy link
Member

LGTM pending squash

Co-Authored-By: Andrew Rudoi <arudoi@newrelic.com>
Co-Authored-By: Roger Torrentsgeneros <rtorrents@newrelic.com>
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: trutx, vincepri

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 18, 2020
@k8s-ci-robot k8s-ci-robot merged commit 5d70dff into kubernetes-sigs:master Mar 18, 2020
@trutx trutx deleted the rtorrents/2653 branch March 19, 2020 10:38
@trutx
Copy link
Contributor Author

trutx commented Mar 19, 2020

Back from pseudo-holidays and all the work is done. Thanks y'all :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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.

KCP: expose additional LeaderElection configuration as flags
7 participants