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

feat: allow passing mkfs format options via storage class parameters #747

Conversation

lukasmetzner
Copy link
Contributor

@lukasmetzner lukasmetzner commented Oct 10, 2024

User can now pass format options directly to mkfs via storage class parameters for every fstype.

Older kernels might not be compatible with the mkfs.xfs options we set. As mkfs.xfs provides a default set of options for certain linux kernel lts versions we can choose the appropriate set of values by inspecting the current kernel version.

If we can find a suitable config we fall back to the most compatible version with older kernels.

BEGIN_COMMIT_OVERRIDE
feat: allow passing mkfs format options via storage class parameters (#747)
feat: change XFS default options to support older kernels (#747)
END_COMMIT_OVERRIDE

@lukasmetzner lukasmetzner self-assigned this Oct 10, 2024
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 35.89%. Comparing base (0b6e860) to head (216294a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/volumes/mount.go 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #747      +/-   ##
==========================================
- Coverage   35.96%   35.89%   -0.08%     
==========================================
  Files          19       19              
  Lines        1835     1850      +15     
==========================================
+ Hits          660      664       +4     
- Misses       1142     1153      +11     
  Partials       33       33              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lukasmetzner lukasmetzner force-pushed the 690-support-a-minimal-node-kernel-version-for-the-xfs-options-compatibility branch from 94cd9cc to f258593 Compare October 10, 2024 13:29
@lukasmetzner lukasmetzner force-pushed the 690-support-a-minimal-node-kernel-version-for-the-xfs-options-compatibility branch from f457046 to 0215469 Compare October 11, 2024 14:52
Copy link
Member

@jooola jooola left a comment

Choose a reason for hiding this comment

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

I am really unsure what the best way of configuring the xfs settings is.

I wrote a bunch of ideas, let me know what you think. I'd wait for Julian's input before merging this anyways :)

@lukasmetzner lukasmetzner force-pushed the 690-support-a-minimal-node-kernel-version-for-the-xfs-options-compatibility branch 7 times, most recently from 2d2c235 to 0e7173e Compare October 18, 2024 11:05
@lukasmetzner lukasmetzner marked this pull request as ready for review October 22, 2024 10:07
@lukasmetzner lukasmetzner requested a review from a team as a code owner October 22, 2024 10:07
@lukasmetzner lukasmetzner force-pushed the 690-support-a-minimal-node-kernel-version-for-the-xfs-options-compatibility branch 2 times, most recently from 6b9e25c to f34cea5 Compare October 22, 2024 10:13
@lukasmetzner lukasmetzner force-pushed the 690-support-a-minimal-node-kernel-version-for-the-xfs-options-compatibility branch from dd1aecb to 3a5232e Compare October 22, 2024 11:00
@lukasmetzner lukasmetzner force-pushed the 690-support-a-minimal-node-kernel-version-for-the-xfs-options-compatibility branch 2 times, most recently from 2e66ebe to 3b87d16 Compare October 22, 2024 12:57
@lukasmetzner lukasmetzner force-pushed the 690-support-a-minimal-node-kernel-version-for-the-xfs-options-compatibility branch from 0206921 to 1bfaff4 Compare October 23, 2024 08:32
@lukasmetzner lukasmetzner changed the title feat: Support for older kernels with XFS Volumes feat: allow passing mkfs format options via storage class parameters Oct 24, 2024
lukasmetzner and others added 23 commits October 25, 2024 11:25
If all nodes in your cluster run the same kernel version, the CSI driver will automatically determine the correct `mkfs.xfs` options.

However, if your cluster has nodes with different kernel versions, older nodes may fail to mount volumes created by newer kernels. To avoid this issue, you can set a minimum kernel version via `xfsMinSupportedKernel`. This ensures that all nodes use the appropriate `mkfs.xfs` defaults for maximum compatibility.

The following strings are valid versions, but only the major, minor, and patch components are considered. If a major, minor, or patch version is not provided, it is evaluated as `0`.
After switching to the mount-utils library from k8s the xfs format options and fallback method have to be reimplemented.
@lukasmetzner lukasmetzner force-pushed the 690-support-a-minimal-node-kernel-version-for-the-xfs-options-compatibility branch from 30cf739 to 216294a Compare October 25, 2024 09:28
@lukasmetzner lukasmetzner merged commit 4b9aa4e into main Oct 25, 2024
8 checks passed
@lukasmetzner lukasmetzner deleted the 690-support-a-minimal-node-kernel-version-for-the-xfs-options-compatibility branch October 25, 2024 12:41
lukasmetzner pushed a commit that referenced this pull request Oct 29, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.10.0](v2.9.0...v2.10.0)
(2024-10-29)


### Features

* add support & tests for Kubernetes 1.31
([#721](#721))
([85035b9](85035b9))
* allow arbitrary length API tokens
([#724](#724))
([61c3a0e](61c3a0e))
* allow passing mkfs format options via storage class parameters
([#747](#747))
([4b9aa4e](4b9aa4e))
* change XFS default options to support older kernels
([#747](#747))
([4b9aa4e](4b9aa4e))
* drop tests for Kubernetes 1.27
([#722](#722))
([d46a54b](d46a54b))
* force pods with volumes to be scheduled on Cloud servers
([#743](#743))
([702fe01](702fe01))
* fstype is directly passed to mkfs: mkfs.<fstype>
([#749](#749))
([173bf2f](173bf2f))
* support for SELinux mount
([#756](#756))
([719247e](719247e)),
closes [#582](#582)
* Support SINGLE_NODE_MULTI_WRITER capability
([#725](#725))
([cd53c23](cd53c23)),
closes [#327](#327)
* **swarm:** removed workaround support for mock staging/unstaging
([#746](#746))
([465ec21](465ec21))


### Bug Fixes

* do not log sensitive mount options
([#755](#755))
([0b6e860](0b6e860))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
lukasmetzner pushed a commit that referenced this pull request Nov 11, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.10.0](v2.9.0...v2.10.0)
(2024-10-29)


### Features

* add support & tests for Kubernetes 1.31
([#721](#721))
([85035b9](85035b9))
* allow arbitrary length API tokens
([#724](#724))
([61c3a0e](61c3a0e))
* allow passing mkfs format options via storage class parameters
([#747](#747))
([4b9aa4e](4b9aa4e))
* change XFS default options to support older kernels
([#747](#747))
([4b9aa4e](4b9aa4e))
* drop tests for Kubernetes 1.27
([#722](#722))
([d46a54b](d46a54b))
* force pods with volumes to be scheduled on Cloud servers
([#743](#743))
([702fe01](702fe01))
* fstype is directly passed to mkfs: mkfs.<fstype>
([#749](#749))
([173bf2f](173bf2f))
* support for SELinux mount
([#756](#756))
([719247e](719247e)),
closes [#582](#582)
* Support SINGLE_NODE_MULTI_WRITER capability
([#725](#725))
([cd53c23](cd53c23)),
closes [#327](#327)
* **swarm:** removed workaround support for mock staging/unstaging
([#746](#746))
([465ec21](465ec21))


### Bug Fixes

* do not log sensitive mount options
([#755](#755))
([0b6e860](0b6e860))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support a minimal node kernel version for the XFS options compatibility
3 participants