Skip to content

nfs: add support for modifying clients parameter via VolumeAttributesClass#6219

Draft
nixpanic wants to merge 5 commits intoceph:develfrom
nixpanic:ai/bob/nfs/ControllerModifyVolume/clients
Draft

nfs: add support for modifying clients parameter via VolumeAttributesClass#6219
nixpanic wants to merge 5 commits intoceph:develfrom
nixpanic:ai/bob/nfs/ControllerModifyVolume/clients

Conversation

@nixpanic
Copy link
Copy Markdown
Member

@nixpanic nixpanic commented Apr 2, 2026

Describe what this PR does

This PR adds support for modifying the NFS clients parameter using VolumeAttributesClass. This allows administrators to update the list of hostnames, networks, or IP addresses that are allowed to access an NFS export after the volume has been created, without needing to recreate the volume.

The implementation includes:

  • Support for the clients parameter in ControllerModifyVolume CSI method
  • Helper method SetClients() in the NFSVolume type to persist the clients list in the export configuration
  • Comprehensive E2E test that validates the functionality by:
    • Creating a volume with restrictive clients (1.1.1.1)
    • Verifying that an app fails to mount with restrictive settings
    • Updating the clients parameter via VolumeAttributesClass to allow all clients (0.0.0.0/0)
    • Verifying that the app successfully mounts after the update
  • Updated documentation in example YAML files

Is there anything that requires special attention

Kubernetes Version Requirement: This feature requires Kubernetes >= 1.34, as VolumeAttributesClass is a newer Kubernetes feature. The E2E test includes a version check to skip on older clusters.

Backward Compatibility: This change is fully backward compatible. The clients parameter remains optional and existing volumes continue to work without modification. The feature only activates when a VolumeAttributesClass is applied to update the parameter.

Security Consideration: Administrators should be aware that updating the clients parameter can expand or restrict access to NFS exports. The E2E test demonstrates both restrictive and permissive configurations to validate proper behavior.

Related issues

This PR implements support for modifying NFS export access controls dynamically, which is useful for scenarios where access requirements change after volume provisioning.

Depends-on: ceph/go-ceph#1261

Future concerns

  • Additional mutable parameters could be supported in future PRs (e.g., secType)
  • Consider adding validation for the clients parameter format to catch configuration errors early

Show available bot commands

These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:

  • /retest ci/centos/<job-name>: retest the <job-name> after unrelated
    failure (please report the failure too!)

@mergify mergify Bot added the component/nfs Issues related to NFS label Apr 2, 2026
@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 2, 2026

/test ci/centos/k8s-e2e-external-storage/1.35/cephfs

Comment thread internal/nfs/types/volume.go Outdated
@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch 6 times, most recently from 100405b to c27e00a Compare April 3, 2026 08:28
@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 3, 2026

/test ci/centos/k8s-e2e-external-storage/1.35/cephfs

@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 3, 2026

/test ci/centos/mini-e2e-helm/k8s-1.35/cephfs

@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 3, 2026

/test ci/centos/mini-e2e-helm/k8s-1.35/nfs

@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 3, 2026

/test ci/centos/mini-e2e-helm/k8s-1.35

@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 7, 2026

/test ci/centos/mini-e2e/k8s-1.35/cephfs

@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 8, 2026

from the logs:

  [FAIL] nfs Test NFS CSI [It] create a storageclass with clients restriction and modify it with VolumeAttributesClass

Still investigating why this happened.

@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch from c27e00a to 05387b2 Compare April 8, 2026 07:56
@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 8, 2026

/test ci/centos/mini-e2e/k8s-1.35/cephfs

@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch from 05387b2 to d09bc7c Compare April 8, 2026 16:31
@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 8, 2026

/test ci/centos/mini-e2e/k8s-1.35/nfs

@nixpanic
Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/cephfs

@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch from d09bc7c to c98cc9e Compare April 16, 2026 09:25
@nixpanic
Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/cephfs

1 similar comment
@nixpanic
Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/cephfs

@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch from 1daa523 to 9df6b50 Compare April 17, 2026 08:09
@nixpanic
Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/cephfs

@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch from 9df6b50 to 67f7e3c Compare April 17, 2026 08:17
@nixpanic
Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/cephfs

@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch from 67f7e3c to 736d84f Compare April 17, 2026 10:37
@nixpanic
Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/cephfs

@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch from 736d84f to b5925aa Compare April 17, 2026 12:03
@nixpanic
Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/cephfs

@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch from b5925aa to 43a9782 Compare April 17, 2026 13:03
@nixpanic
Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/cephfs

@nixpanic
Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.34/cephfs

The ControllerModifyVolume CSI procedure can now be used to modify the
`clients` parameter that was originally configured in the StorageClass.

The SetClients() method uses the NFS Admin API to update the export on
the cluster (via ExportInfo + ApplyExportInfo) and stores the value in
the journal for persistence.

Assisted-by: AskBob <askbob@ibm.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
Add comprehensive e2e test that verifies the clients parameter can be
modified using VolumeAttributesClass. The test:
- Creates a volume with restrictive clients (1.1.1.1)
- Verifies that an app fails to mount with restrictive settings
- Updates the clients parameter via VolumeAttributesClass to allow all
  clients (0.0.0.0/0)
- Verifies that the app successfully mounts after the update

The test runs just before the cleanup phase to ensure proper test
sequencing.

Assisted-by: AskBob <askbob@ibm.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
/!\ DO NOT MERGE

This uses a personal branch for testing.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch from 43a9782 to af268d8 Compare April 17, 2026 15:50
@nixpanic
Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/cephfs

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 21, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 ⛓️ Depends-On Requirements

Wonderful, this rule succeeded.

Requirement based on the presence of Depends-On in the body of the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/nfs Issues related to NFS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant