-
Notifications
You must be signed in to change notification settings - Fork 608
nfs: implement ControllerModifyVolume to change NFS-server hostname #5829
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bfb3105
nfs: create helpers for storing volume attributes in the journal
nixpanic 48f42d3
nfs: fail early in NodeGetVolumeStats
nixpanic f9cec9a
nfs: move NFSVolume to shared types package
nixpanic 52932ea
nfs: make `paramServer` shared option public
nixpanic ce90778
nfs: implement ControllerModifyVolume to change NFS-server hostname
nixpanic 05407b9
e2e: cleanup k8s.io module dependencies
nixpanic 80b65b7
e2e: add VolumeAttributesClass test for NFS
nixpanic 0016f37
doc: include reference to NFS/ControllerModifyVolume in release-notes
nixpanic 29b353e
testing: use canary images for csi-resizer/provisioner
nixpanic 56d32c3
deploy: allow NFS-provisioner to access volumeattributesclasses
nixpanic 72cef3f
ci: include publish-secret in StorageClass for NFS
nixpanic 5f882c5
doc: mention support for NFS-server hostname changing
nixpanic b4565bd
doc: add details about VolumeAttributeClass secrets
nixpanic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # VolumeAttributesClass for Volume Modification | ||
|
|
||
| Kubernetes offers a method for modifying Volume parameters after they have been | ||
| created. This is done through VolumeAttributesClasses and is described in a | ||
| [blog | ||
| post](https://kubernetes.io/blog/2025/09/08/kubernetes-v1-34-volume-attributes-class). | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Kubernetes 1.34 is the first release where support for | ||
| VolumeAttributesClasses (the `ControllerModifyVolume` CSI procedure) is GA. | ||
| Older versions of Kubernetes may not work reliably. | ||
| - The Kubernetes CSI external-provisioner (`csi-provisioner` sidecar) release | ||
| needs to be higher or equal to v6.1 (support for secrets). | ||
| - The Kubernetes CSI external-resizer (`csi-resizer` sidecar) release | ||
| needs to be higher or equal to v2.1 (support for secrets). | ||
|
|
||
| ## Secret references in the StorageClass | ||
|
|
||
| When setting a VolumeAttributesClass on a PersistentVolumeClaim, the | ||
| `ControllerModifyVolume` CSI procedure is called on the provisioner. This | ||
| procedure needs secrets (that contain the Ceph credentials) in order to | ||
| communicate with the Ceph cluster. Below are the keys that should be set in the | ||
| StorageClass' `parameters`: | ||
|
|
||
| - `csi.storage.k8s.io/controller-modify-secret-name` | ||
| - `csi.storage.k8s.io/controller-modify-secret-namespace` | ||
|
|
||
| In addition to the execution of `ControllerModifyVolume`, the Node-plugin needs | ||
| access to the Volume on the Ceph cluster to fetch the updated parameters. | ||
| Usually NFS and NVMe-oF do not need any Ceph credentials for the Node-plugin, | ||
| but for using VolumeAttributesClasses to modify Volumes this is a requirement. | ||
|
|
||
| Depending on the storage backend, Volumes are optionally _Staged_ before | ||
| getting _Published_. NVMe-oF uses the staging process, and needs credentials | ||
| there, hence these parameters should be set: | ||
|
|
||
| - `csi.storage.k8s.io/node-stage-secret-name` | ||
| - `csi.storage.k8s.io/node-stage-secret-namespace` | ||
|
|
||
| NFS does not use the staging process, and only needs the credentials during the | ||
| publishing process: | ||
|
|
||
| - `csi.storage.k8s.io/node-publish-secret-name` | ||
| - `csi.storage.k8s.io/node-publish-secret-namespace` | ||
|
|
||
| ## Adding support to existing Volumes | ||
|
|
||
| PersistentVolumeClaims that have not been created with the right secret | ||
| references in the StorageClass will not be modifiable with a | ||
| VolumeAttributesClass without manual intervention. | ||
|
|
||
| In order to be able to modify parameters with a VolumeAttributesClass, | ||
| annotations should be added to the PersistentVolume that is _Bound_ to the | ||
| PersistentVolumeClaim. These annotations should refer to the namespace and | ||
| secret where the credentials are available (just like the namespace and secret | ||
| that would be referenced in the StorageClass). | ||
|
|
||
| - `volume.kubernetes.io/controller-modify-secret-name` | ||
| - `volume.kubernetes.io/controller-modify-secret-namespace` | ||
|
|
||
| Note that these annotations only make it possible for the provisioner to modify | ||
| parameters. This does not allow the Node-plugin accessing the Ceph cluster to | ||
| fetch updated parameters when the Volume is _staged_ or _published_. The | ||
| secrets for staging and publishing can not (easily) be updated after the fact, | ||
| these are part of the fixed parameters in the PersistentVolume. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
|
nixpanic marked this conversation as resolved.
|
||
| # apiVersion: storage.k8s.io/v1beta1 for k8s version 1.33 | ||
| apiVersion: storage.k8s.io/v1 | ||
| kind: VolumeAttributesClass | ||
| metadata: | ||
| name: updated-parameters | ||
| driverName: nfs.csi.ceph.com | ||
| parameters: | ||
| # "server" can be an alternative NFS-server that should be used when the | ||
| # volume is attached the next time to a node. | ||
| server: to-be-deployed.example.net | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a TODO and tracker to revert this to released version ?
(:sweat: we made a similar change and forgot to revert before too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, created #5955 for that.