Skip to content

Flag gate for topology and leader election#148

Merged
k8s-ci-robot merged 3 commits intokubernetes-csi:masterfrom
verult:flag-gates
Oct 16, 2018
Merged

Flag gate for topology and leader election#148
k8s-ci-robot merged 3 commits intokubernetes-csi:masterfrom
verult:flag-gates

Conversation

@verult
Copy link
Contributor

@verult verult commented Oct 8, 2018

/kind bug
/priority critical-urgent

Fixes #146 and #147

I'm not a fan of how the topology flag is set up, but I'm hitting some hurdles integrating the feature gate mechanism from k8s/k8s here (namely how to properly setup spf13/pflags). Going to try to resolve those issues

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 8, 2018
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 9, 2018
@verult verult changed the title [WIP] Flag gate for topology and leader election Flag gate for topology and leader election Oct 9, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 9, 2018
@verult
Copy link
Contributor Author

verult commented Oct 9, 2018

Depends on #145 to resolve external-snapshotter dependency issue in Travis

@verult
Copy link
Contributor Author

verult commented Oct 9, 2018

/assign @jsafrane @saad-ali

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. labels Oct 9, 2018
@davidz627
Copy link
Contributor

Not sure it's necessary to add this whole new flag gating mechanism. Could we just have it as a normal command line flag or is there a compelling reason not to do that?

Currently v0.4.0 of the provisioner used with a topology supporting driver is not compatible with any Kubernetes cluster except for 1.12 with Alpha Topology support enabled so I would consider this high priority.

/cc @jingxu97
for tracking as this is blocking GCE PD CSI Driver Snapshots Support

@k8s-ci-robot
Copy link
Contributor

@davidz627: GitHub didn't allow me to request PR reviews from the following users: jingxu97.

Note that only kubernetes-csi members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

Not sure it's necessary to add this whole new flag gating mechanism. Could we just have it as a normal command line flag or is there a compelling reason not to do that?

Currently v0.4.0 of the provisioner used with a topology supporting driver is not compatible with any Kubernetes cluster except for 1.12 with Alpha Topology support enabled so I would consider this high priority.

/cc @jingxu97
for tracking as this is blocking GCE PD CSI Driver Snapshots Support

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.

@verult
Copy link
Contributor Author

verult commented Oct 10, 2018

The simplest approach to adding a command-line flag would involve plumbing the flag parameter to every code path that checks the flag, which doesn't scale very well. We'd need a global source of truth for feature gates, and the library in k8s sets that up nicely so we don't have to write our own.

@verult
Copy link
Contributor Author

verult commented Oct 10, 2018

Status update: PR #145 depends on external-snapshotter being tagged, which will be done today

@wongma7
Copy link

wongma7 commented Oct 10, 2018

enableLeaderElection should default false to match external-attacher imo.

@pohly
Copy link
Contributor

pohly commented Oct 11, 2018

enableLeaderElection should default false to match external-attacher imo.

That, and it's also the right default for a StatefulSet (which is what many people and the example use) because then leader election isn't needed.

@verult
Copy link
Contributor Author

verult commented Oct 11, 2018

@pohly what kind of configuration would be used if leader election were enabled?

@pohly
Copy link
Contributor

pohly commented Oct 12, 2018 via email

volumeNamePrefix = flag.String("volume-name-prefix", "pvc", "Prefix to apply to the name of a created volume.")
volumeNameUUIDLength = flag.Int("volume-name-uuid-length", -1, "Truncates generated UUID of a created volume to this length. Defaults behavior is to NOT truncate.")
showVersion = flag.Bool("version", false, "Show version.")
enableLeaderElection = flag.Bool("enable-leader-election", false, "Enables leader election.")
Copy link
Member

Choose a reason for hiding this comment

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

Add to comment: enabling may require additional RBAC

@msau42
Copy link
Collaborator

msau42 commented Oct 16, 2018

Is this change ready to go?

@verult verult force-pushed the flag-gates branch 2 times, most recently from 36d34c3 to b634ade Compare October 16, 2018 22:20
Copy link
Member

@saad-ali saad-ali left a comment

Choose a reason for hiding this comment

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

/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 Oct 16, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saad-ali, verult

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

The pull request process is described here

Details 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 Oct 16, 2018
@k8s-ci-robot k8s-ci-robot merged commit 6ba243b into kubernetes-csi:master Oct 16, 2018
k8s-ci-robot added a commit that referenced this pull request Oct 16, 2018
@davidz627
Copy link
Contributor

@verult can a new provisioner version be cut for this?

@verult
Copy link
Contributor Author

verult commented Oct 17, 2018

v0.4.1 has been cut!

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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a flag to enable/disable leader election

8 participants