[cinder-csi-plugin] Add mkfsOptions StorageClass parameter#3084
[cinder-csi-plugin] Add mkfsOptions StorageClass parameter#3084rybnico wants to merge 1 commit intokubernetes:masterfrom
Conversation
|
|
|
Hi @rybnico. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
5c03378 to
d7fa2d8
Compare
|
/ok-to-test |
|
reading the https://github.com/kubernetes/utils/blob/28399d86e0b55e612b83ad94dc6bac8e5de2a5ac/mount/mount_linux.go#L396 source code it seems that this is not a |
d7fa2d8 to
715349b
Compare
No, it's an option for |
could you point me to the code that passes |
Of course - but we don't pass them as argument We create In In mount-utils, the options is finally passed to formatAndMountSensitive and added to the |
pkg/csi/cinder/nodeserver.go
Outdated
| // parseMkfsOptions splits a comma-separated mkfsOptions string into individual | ||
| // command-line arguments. Each comma-separated token is further split on | ||
| // whitespace. Empty tokens are filtered out. | ||
| func parseMkfsOptions(mkfsOpts string) []string { |
There was a problem hiding this comment.
you can use
cloud-provider-openstack/pkg/util/util.go
Lines 175 to 182 in 9c80105
| |------------------------- |-----------------------|-----------------|-----------------| | ||
| | StorageClass `parameters` | `availability` | `nova` | String. Volume Availability Zone | | ||
| | StorageClass `parameters` | `type` | Empty String | String. Name/ID of Volume type. Corresponding volume type should exist in cinder | | ||
| | StorageClass `parameters` | `mkfsOptions` | Empty String | String. Comma-separated mkfs options passed to mkfs when formatting the volume. Useful for passing `-E nodiscard` on Ceph-backed storage to speed up provisioning. | |
There was a problem hiding this comment.
it makes sense to use kebab-case style here
Add support for a new `mkfsOptions` StorageClass parameter that allows cluster admins to pass custom mkfs flags when formatting volumes. This is particularly useful for Ceph-backed storage where passing `-E nodiscard` to mkfs.ext4 can dramatically speed up provisioning (e.g. from ~7 minutes to seconds for a 100 GB volume). The parameter value is comma-separated, with each token further split on whitespace to produce individual mkfs command-line arguments. Example: `mkfsOptions: "-E nodiscard,-O ^metadata_csum"` Implementation: - Extract mkfsOptions from StorageClass params in CreateVolume and pass via VolumeContext (both new-volume and idempotent early-return paths) - Parse mkfsOptions in NodeStageVolume using parseMkfsOptions() helper - Use FormatAndMountSensitiveWithFormatOptions() from k8s.io/mount-utils to pass format options separately from mount options - No behavior change when mkfsOptions is not set Inspired by the Ceph CSI implementation (ceph/ceph-csi#621).
715349b to
cbc2205
Compare

What this PR does / why we need it:
Add support for a new
mkfsOptionsStorageClass parameter that allows cluster admins to pass custom mkfs flags when formatting volumes. This is particularly useful for Ceph-backed storage where passing-E nodiscardto mkfs.ext4 can dramatically speed up provisioning (e.g. from ~7 minutes to seconds for a 100 GB volume).The parameter value is comma-separated, with each token further split on whitespace to produce individual mkfs command-line arguments. Example:
mkfsOptions: "-E nodiscard,-O ^metadata_csum"Implementation:
Which issue this PR fixes(if applicable):
fixes #3068
Special notes for reviewers:
Inspired by the Ceph CSI implementation (ceph/ceph-csi#621).
Release note: