[cinder-csi-plugin] Add mkfsOptions StorageClass parameter#3084
[cinder-csi-plugin] Add mkfsOptions StorageClass parameter#3084rybnico wants to merge 1 commit intokubernetes:masterfrom
Conversation
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). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Please update your commit message(s) by doing |
|
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 |
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: