Storage class

Storage class is used for creating lightweight volumes as well as fileset-based volumes.

Storage class for creating lightweight volumes

This is the configuration:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ibm-spectrum-scale-csi-lt
provisioner: spectrumscale.csi.ibm.com
parameters:
  volBackendFs: "gpfs0"
  volDirBasePath: "pvfileset/lwdir"
reclaimPolicy: Delete
Description of the fields
Field name Description
volBackendFs File system on which directory-based volume should be created.
volDirBasePath Base path under which all volumes with this storage class created. This path must exist. Relative path from the file system mount point.
uid uid/username that should be assigned to the directory. This is optional. The uid/gid must exist on the IBM Spectrum Scale GUI node.
gid gid/groupname that should be assigned to the directory. This is optional. The uid/gid must exist on the IBM Spectrum Scale GUI node.
permissions Permissions to be set on volume parent directory. This parameter is optional.
Note:
  • For subpath support, add permissions = 777 in the storageClass. Using 777 directory permission might pose security risk. Use 777 directory permission with caution.
  • Use of incorrect permissions might lead to loss to data access.
Note:
  • Since lightweight volume does not enforce quota, it can grow beyond defined size, which may result in consuming whole filesystem. To avoid this, it is highly recommended to manually create(or use existing) fileset to host the lightweight PVC volumes. This can be done by specifying the directory inside fileset for volDirBasePath option.
  • Do not use fileset created by IBM Spectrum Scale Driver for hosting lightweight volumes. Because when fileset based volumes gets deleted, all the data under fileset including lightweight PVC, if created, also gets deleted.

Storage class for creating fileset based volumes (local file system)

If you want to create PVCs under a file system that is owned by the primary cluster, then use the storageClass details provided in the following example:

In this example, it is assumed that the user wants to create PVCs under the file system, gpfs0, as per the sample deployment explained in Remote cluster support. The same storageClass format is applicable for sample deployment that is explained in Operator.

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
  clusterId: "17797813605352210071"
  uid: "1000"
  gid: "1000"
reclaimPolicy: Delete
Dependent fileset storage class example:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ibm-spectrum-scale-csi-fileset-dependent
provisioner: spectrumscale.csi.ibm.com
parameters:
  volBackendFs: "gpfs0"
  clusterId: "17797813605352210071"
  uid: "1000"    
  gid: "1000"
  filesetType: "dependent"
  parentFileset: "independent-fileset-fset1"
reclaimPolicy: Delete
Note: "17797813605352210071" is the cluster ID of the primary cluster.
Description of the fields
Field name Description
volBackendFs Name of the file system under which the fileset should be created.
clusterId Cluster ID of the primary cluster. This is optional. Default value is the cluster ID of the primary cluster.
uid uid/username that will be assigned to the fileset. This is optional. The uid/gid must exist on the IBM Spectrum Scale GUI node. Default value is "root".
gid gid/group name that will be assigned to the fileset. This is optional. The gid/group name must exist on the IBM Spectrum Scale GUI node. Default value is "root".
filesetType Default value is independent.
parentFileset Parent fileset name. Valid with filesetType=dependent. Default is root.
inodeLimit Inode limit for fileset. This is optional. Valid with filesetType=independent. If not specified, inodeLimit is calculated using this formula: volume size/block size of the file system.
permissions Permissions to be set on volume parent directory. This parameter is optional.
Note:
  • For subpath support, add permissions = 777 in the storageClass. Using 777 directory permission might pose security risk. Use 777 directory permission with caution.
  • Use of incorrect permissions might lead to loss to data access.

StorageClass for creating fileset-based volumes (remote file system)

If you want to create PVCs under a file system that is owned by a different cluster other than the primary cluster, then use the storageClass details that are provided in this example. In this example, it is assumed that the user wants to create PVCs under the file system, gpfs0, as per the sample deployment explained in Remote cluster support. The same storageClass format is applicable for sample deployment that is explained in Operator.

Independent fileset storageClass for the file system

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ibm-spectrum-scale-csi-fileset
provisioner: spectrumscale.csi.ibm.com
parameters:
  volBackendFs: "mygpfs"
  clusterId: "7118073361626808055"
  uid: "1000"
  gid: "1000"
reclaimPolicy: Delete
Dependent fileset storageClass example

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ibm-spectrum-scale-csi-fileset-dependent
provisioner: spectrumscale.csi.ibm.com
parameters:
  volBackendFs: "mygpfs"
  clusterId: " 7118073361626808055"
  uid: "1000"    
  gid: "1000"
  filesetType: "dependent"
  parentFileset: "independent-fileset-fset1"
reclaimPolicy: Delete
Note: Here, 7118073361626808055 represents the cluster ID of the owning cluster (Cluster O).

Description of the fields

Field name Description
volBackendFs Name of the file system under which the fileset should be created. File system name is the name of the remotely mounted file system on the primary cluster.
clusterId Cluster ID of the owning cluster.
uid uid/username that will be assigned to the fileset. This is optional. The uid/gid must exist on the IBM Spectrum Scale GUI node of accessing and owning clusters. Default value is "root".
gid gid/group name that will be assigned to the fileset. This is optional. The gid/group name must exist on the IBM Spectrum Scale GUI node of the accessing and owning clusters. Default value is "root".
filesetType Default is independent. This is optional.
parentFileset Parent fileset name. Valid with filesetType=dependent. Default is root.
inodeLimit Inode limit for fileset. This is optional. Valid with filesetType=independent. If not specified, inodeLimit is calculated using formula volume Size/Block size of filesystem.
permissions Permissions to be set on volume parent directory. This parameter is optional.
Note:
  • For subpath support, add permissions = 777 in the storageClass. Using 777 directory permission might pose security risk. Use 777 directory permission with caution.
  • Use of incorrect permissions might lead to loss to data access.