Skip to content

Conversation

@RaunakShah
Copy link
Contributor

@RaunakShah RaunakShah commented Jun 10, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:
This PR adds command line arguments for leader election options - Lease Duration, Renew Deadline and Retry Period. Currently the defaults are 15, 10 and 5 seconds respectively. Without this change, there's no way for a customer/storage plugin to configure those values.

This PR makes those parameters configurable. Storage plugins deploying external-provisioner can tune those parameters in their YAMLs accordingly.

Which issue(s) this PR fixes:

Fixes #556

Special notes for your reviewer:

Testing:

Created Provisioner with new arguments and verified that Pod is running:

# cat vsphere-csi-driver.yaml
...
        - name: csi-provisioner
          args:
            - "--v=4"
            - "--timeout=300s"
            - "--csi-address=$(ADDRESS)"
            - "--kube-api-qps=100"
            - "--kube-api-burst=100"
            - "--leader-election"
            - "--default-fstype=ext4"
            - "leader-election-lease-duration=30"
            - "leader-election-renew-deadline=20"
            - "leader-election-retry-period=10"
...
# kubectl get pod -n vmware-system-csi
NAME                                      READY   STATUS    RESTARTS   AGE
vsphere-csi-controller-74f57f8754-x2bcj   6/6     Running   0          21m

Does this PR introduce a user-facing change?:

Add command line arguments to configure leader election options

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 10, 2021
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 10, 2021
@ggriffiths
Copy link
Contributor

Looks good once the go fmt issue is fixed

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 10, 2021
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 10, 2021
@ggriffiths
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 10, 2021
@ggriffiths
Copy link
Contributor

It might be good to make these changes in the other sidecars too so the leader election options stay in sync.

/assign @xing-yang for approver

@RaunakShah
Copy link
Contributor Author

@ggriffiths yup thats the plan! Thanks for the quick review!

@ggriffiths
Copy link
Contributor

/assign @xing-yang

@xing-yang
Copy link
Contributor

Should there be "--" in front of these new options?

...
        - name: csi-provisioner
          args:
            - "--v=4"
            - "--timeout=300s"
            - "--csi-address=$(ADDRESS)"
            - "--kube-api-qps=100"
            - "--kube-api-burst=100"
            - "--leader-election"
            - "--default-fstype=ext4"
            - "leader-election-lease-duration=30"
            - "leader-election-renew-deadline=20"
            - "leader-election-retry-period=10"
...

@xing-yang
Copy link
Contributor

there's no way for a customer/storage plugin to configure those values.

My understanding is that these are tunable options when starting the external-provisioner so whoever deploys the CSI driver can configure them?

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 14, 2021
@RaunakShah
Copy link
Contributor Author

@xing-yang

Should there be "--" in front of these new options?

Fixed the description! And redeployed with the --.

My understanding is that these are tunable options when starting the external-provisioner so whoever deploys the CSI driver can configure them?

That's correct, they can be set before creating the pod. I've also added the parameters to the documentation page.

@xing-yang
Copy link
Contributor

xing-yang commented Jun 14, 2021

@RaunakShah, I see the following in PR description:

This PR adds command line arguments for leader election options - Lease Duration, Renew Deadline and Retry Period. Currently the defaults are 15, 10 and 5 seconds respectively and there's no way for a customer/storage plugin to configure those values.

If these options are tunable, why you said "there's no way for a customer/storage plugin to configure those values"? Do you mean, without this change, they can't be configured; but with this change, they are tunable? Maybe separate "the current situation" and "with this change" into two paragraphs?

@RaunakShah
Copy link
Contributor Author

Do you mean, without this change, they can't be configured; but with this change, they are tunable?

@xing-yang This is correct, apologies for the confusion. I've updated the PR description with more clarity!

@xing-yang
Copy link
Contributor

/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 Jun 14, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RaunakShah, xing-yang

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 Jun 14, 2021
@k8s-ci-robot k8s-ci-robot merged commit 6d23280 into kubernetes-csi:master Jun 14, 2021
@jingxu97
Copy link
Contributor

@RaunakShah Thanks for the PR. Do you mind making the similar changes to other csi sidecars? Thanks!

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/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add command line arguments for leader election parameters

5 participants