Skip to content

Use one StorageClass & PV with multiple Nas Paths #950

@jinhee6930

Description

@jinhee6930

Hi,
I have a question about configuring csi-driver-nfs.
For explanation purposes, let’s assume the following setup:

  • Using csi-driver-nfs
  • A single Kubernetes cluster
  • One NAS server

In this setup, there are five different namespaces in Kubernetes, each hosting a different application:
Applications: A, B, C, D, E
Pods of Application A use the /service/A path on the NAS.
Pods of Application B use the /service/B path on the NAS.

Pods of Application E use the /service/E path on the NAS.

In this scenario, if I want to dynamically provision PVs using a StorageClass, do I need to create five separate StorageClasses?
All settings except for the share parameter are identical, so I would like to use only one StorageClass. Is this possible?
From what I understand, using the StorageClass subDir or PV/PVC volumeAttributes.share could make this possible. However, the documentation is brief and there are very few examples, so I’m not sure how to do it.
It seems that using the StorageClass subDir or PV/PVC volumeAttributes.share might make this possible, but the documentation is brief and there are very few examples, so I’m not sure how to implement it.
There are no examples showing the usage of volumeAttributes.share directly in a PVC. According to (https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/docs/driver-parameters.md#pvpvc-usage-static-provisioning), it seems possible because it mentions “PV/PVC Usage,” but no examples are provided.
If it is possible to specify share in a PVC, does it override the share defined in the StorageClass?
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/supportCategorizes issue or PR as a support question.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions