Skip to content

[Doc] volumeHandle format does not match with volumeHandle in dynamically provisioned PersistentVolume #1006

@xiangfeiz

Description

@xiangfeiz

What happened:
On this doc (https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/example/pv-nfs-csi.yaml), it says

  csi:
    driver: nfs.csi.k8s.io
    # volumeHandle format: {nfs-server-address}#{sub-dir-name}#{share-name}
    # make sure this value is unique for every share in the cluster
    volumeHandle: nfs-server.default.svc.cluster.local/share##
    volumeAttributes:
      server: nfs-server.default.svc.cluster.local
      share: /

Example (nfs-server.default.svc.cluster.local/share##) does not match volumeHandle format ({nfs-server-address}#{sub-dir-name}#{share-name}).

On another doc (https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/docs/driver-parameters.md), it gives the same format ({nfs-server-address}#{sub-dir-name}#{share-name}) but a different example (nfs-server.default.svc.cluster.local/share#subdir#)

VolumeID(volumeHandle) is the identifier of the volume handled by the driver, format of VolumeID:
{nfs-server-address}#{sub-dir-name}#{share-name}
example: nfs-server.default.svc.cluster.local/share#subdir#

When I deployed a PVC which created a PV dynamically, I see a different format of volumeHandle in PV yaml like:

  csi:
    driver: nfs.csi.k8s.io
    volumeAttributes:
      server: nfs-server.default.svc.cluster.local
      share: /my/share/path
      subdir: pvc-40937199-8986-4032-aeea-74ccd1d18418
    volumeHandle: nfs-server.default.svc.cluster.local#my/share/path#pvc-40937199-8986-4032-aeea-74ccd1d18418##

The volumeHandle format seems to be {nfs-server-address}#{share-without-leading-slash}#{subdir-name}##

When I tried to create a static PV pointing to the same location of the dynamically created PV, I need to use the exact volumeHandle in the dynamically provisioned one and I must specify subdir (the example PV, https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/example/pv-nfs-csi.yaml, does not include subdir).

What you expected to happen:
volumeHandle format in doc and example should match with latest format.

How to reproduce it:
1 Create a PVC to dynamically create a PV
2 Check volumeHandle in PV

Anything else we need to know?:
My StorageClass does not specify parameters.subdir

Environment:

  • CSI Driver version: v4.12.1
  • Kubernetes version (use kubectl version): v1.30.2
  • OS (e.g. from /etc/os-release): Photon OS 5.0
  • Kernel (e.g. uname -a): 6.1.102-3.ph5
  • Install tools: helm
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions