Static provisioning in a dynamic way (recommended)

Static provisioning in a dynamic way can use an existing fileset by defining the StorageClass and PVC, similar to dynamic provisioning. A cluster administrator is required only to create a storage class (or multiple storage classes). A new volume is then automatically provisioned and created on demand for each user's persistent volume claim (PVC) request. This feature is supported starting with the IBM Storage Scale Container Storage Interface 2.14.x. It enhances the capabilities for volume operations, such as volume snapshot, cloning, and restore, with greater flexibility

This method also supports the following volume operations:
  • Volume snapshot
  • Volume cloning
  • Volume expansion
  • Volume restore
Note: The target for volume cloning and volume snapshot must be a dynamically created volume. Using a static persistent volume (PV) as the target is not allowed because it contains preexisting data that can be overwritten.
To provision a static volume in a dynamic way, do the following steps:
  1. Create a storage class based on the required fileset type (dependent or independent).
    Independent fileset storage class:
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: ibm-spectrum-scale-csi-fileset
    provisioner: spectrumscale.csi.ibm.com
    parameters:
      volBackendFs: gpfs0
      existingVolume: "yes"
    reclaimPolicy: Delete
    Dependent fileset storage class:
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: ibm-spectrum-scale-csi-fileset-dependent
    provisioner: spectrumscale.csi.ibm.com
    parameters:
      volBackendFs: "gpfs0"
      existingVolume: "yes"
      filesetType: "dependent"
      parentFileset: "independent-fileset-fset1"
    reclaimPolicy: Delete
    The following fields are available for the "parameters:" section in a StorageClass manifest. The "parameters:" section is a mandatory section for the IBM Storage Scale Container Storage Interface driver storageClass:
    Field name Description
    volBackendFs The name of the file system under which the fileset should be created.

    When a file system that is owned by a different cluster, the file system name is the name of the remotely mounted file system on the primary cluster.

    existingVolume (must be used for static PV)

    The valid option is yes. This parameter is used to identify that the provisioned volume is a static volume.

    filesetType The valid options are independent and dependent. The default value is independent.
    parentFileset Parent fileset name. Valid with filesetType=dependent. The default value is root.
    Note: Static provisioning in a dynamic way does not support the following features:
    • Consistency group
    • ReadOnlyMany
  2. Apply the following configuration:
    kubectl apply -f storageclass.yaml
  3. Modify the following PVC manifest for the name, storage, and storageClassName values according to your requirement:
    # cat pvc.yaml
    
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: scale-fset-pvc
    spec:
      accessModes:
      - ReadWriteMany
      resources:
        requests:
          storage: 1Gi
      storageClassName: [name_of_your_storageclass]
    Restriction: The PVC name must match the fileset name of the existing data that will be used for the mount.
  4. Create a PVC with the modified manifest by issuing the following command.
    kubectl apply -f pvc.yaml

Limitation

When multiple PVCs and PVs are created from the same fileset, any PVC can trigger the expansion of the fileset. The other PVCs retain their originally requested sizes. However, they can still consume storage beyond their allocated size up to the total capacity of the expanded fileset. Because any PVC can increase the fileset size.