You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem?/Why is this needed**
Currently, the subDir parameter is supported in StorageClass, allowing PVCs to be created inside a specific folder. This is particularly useful for organizing and separating data by directories in the NFS CSI driver.
VolumeSnapshotClass should support the subDir parameter, just like StorageClass. This would allow snapshots to be stored in the same subdirectory as their corresponding PVCs when using the NFS CSI driver.
Since VolumeSnapshotClass already has a parameters field, this change would require modifications to the CSI driver and would not impact any Kubernetes core components or external-snapshotter behavior.
Proposed Parameter Handling:
The subDir parameter should be processed within the CSI driver to determine the directory where snapshots are stored. Below is an example configuration:
If subDir is specified, the snapshot will be stored inside the given subdirectory.
If not specified, the default behavior (storing in the root directory) remains unchanged.
Describe alternatives you've considered
Manually moving snapshots to the desired subdirectory after creation, which is not ideal due to automation and access control limitations. Additionally, the VolumeSnapshotContent.status.snapshotHandle would also need to be manually updated, which is not supported by Kubernetes and can lead to inconsistencies.
Additional context
This feature would be particularly beneficial for this CSI driver, where organizing snapshots in specific directories can improve manageability. Allowing users to specify subDir in VolumeSnapshotClass ensures consistency in snapshot placement and improves manageability.
Additionally, modifying subDir does not affect existing snapshots. Since parameters in VolumeSnapshotClass cannot be modified after creation, users must create a new VolumeSnapshotClass with the desired subDir. Moreover, the snapshotHandle stored in VolumeSnapshotContent.status includes folder information, ensuring that restoring snapshots remains unaffected by subDir changes.
Expected Directory Structure Change
Current Behavior:
/nfs-root/snapshot-<snapshotUID>
Proposed Behavior with subDir: snapshots:
/nfs-root/snapshots/snapshot-<snapshotUID>
The text was updated successfully, but these errors were encountered:
the VolumeSnapshotClass supports share parameter (it's / by default), which means you could create a dedicated subdir in root dir to store snapshot, original snapshot volume id does not contain subDir which means this could be a breaking change if we support subDir in VolumeSnapshotClass since we also need to add subDir into snapshot volume id if we want to support subDir in VolumeSnapshotClass
Is your feature request related to a problem?/Why is this needed**
Currently, the
subDir
parameter is supported inStorageClass
, allowing PVCs to be created inside a specific folder. This is particularly useful for organizing and separating data by directories in the NFS CSI driver.However, when creating snapshots via
VolumeSnapshot
, there is no option to specifysubDir
. As a result, snapshots are always stored in the root directory of the NFS server, with names likesnapshot-<snapshotUID>
.https://github.com/kubernetes-csi/external-snapshotter/blob/v8.2.0/pkg/sidecar-controller/csi_handler.go#L87
Describe the solution you'd like in detail
VolumeSnapshotClass
should support thesubDir
parameter, just likeStorageClass
. This would allow snapshots to be stored in the same subdirectory as their corresponding PVCs when using the NFS CSI driver.Since
VolumeSnapshotClass
already has aparameters
field, this change would require modifications to the CSI driver and would not impact any Kubernetes core components orexternal-snapshotter
behavior.Proposed Parameter Handling:
The
subDir
parameter should be processed within the CSI driver to determine the directory where snapshots are stored. Below is an example configuration:subDir
is specified, the snapshot will be stored inside the given subdirectory.Describe alternatives you've considered
VolumeSnapshotContent.status.snapshotHandle
would also need to be manually updated, which is not supported by Kubernetes and can lead to inconsistencies.Additional context
This feature would be particularly beneficial for this CSI driver, where organizing snapshots in specific directories can improve manageability. Allowing users to specify
subDir
inVolumeSnapshotClass
ensures consistency in snapshot placement and improves manageability.Additionally, modifying
subDir
does not affect existing snapshots. Sinceparameters
inVolumeSnapshotClass
cannot be modified after creation, users must create a newVolumeSnapshotClass
with the desiredsubDir
. Moreover, thesnapshotHandle
stored inVolumeSnapshotContent.status
includes folder information, ensuring that restoring snapshots remains unaffected bysubDir
changes.Expected Directory Structure Change
Current Behavior:
Proposed Behavior with
subDir: snapshots
:The text was updated successfully, but these errors were encountered: