Configuring storage class to use CSI driver

Storage class is used for creating lightweight volumes and fileset based volumes.

Lightweight (directory) based volumes

A Storage class example for creating directory (lightweight) based volumes is provided.

Adjust the parameters according to your environment.

# cat storageClass_Lightweight.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
    name: ibm-spectrum-scale-csi-lt
provisioner: spectrumscale.csi.ibm.com
parameters:
    volBackendFs: "fs1"
    volDirBasePath: "pvfileset/lwdir" # relative path from filesystem mount point for creating lightweight volume
reclaimPolicy: Delete

Enter the command to create the lightweight storage class:

oc create -f storageClass_Lightweight.yaml

Fileset based volumes

A Storage class example for creating fileset-based volumes is provided.

Adjust the parameters according to your environment.

# cat storageClass_fileset.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
    name: ibm-spectrum-scale-csi-fileset
provisioner: spectrumscale.csi.ibm.com
parameters:
    volBackendFs: fs1
reclaimPolicy: Delete

A sample fileset-based Storage Class is created that uses the primary file system as the volBackendFs. It can be used to create other storage classes with a remote file system. Enter the oc get storageclass -oyaml > storageClass_fileset.yaml command to create a copy of this storage class. Then configure parameters as needed and create the configured storage class by using the following command:

oc create -f storageClass_fileset.yaml

For more information, see Storage class in IBM Storage Scale CSI documentation.