About this task
The storage class must have read, write, and execute permissions on the local file system.
Remember: Storage classes are cluster-wide resources.
Procedure
- Log in to your cluster as a user with sufficient permissions.
- Set the following environment variables:
Variable |
Notes |
FILE_SYSTEM_NAME |
Specify the name of the file system that is mounted by the IBM Spectrum Fusion or IBM Spectrum Scale Container
Native cluster.
- IBM Spectrum Fusion
- Run the following command to get the name of the file system on your Red Hat® OpenShift® Container Platform
cluster:
oc exec $(oc get pod -o name -l app.kubernetes.io/name=core \
-n ibm-spectrum-scale |head -1) -n ibm-spectrum-scale \
-c gpfs -- mmlsfs all -T
- IBM Spectrum Scale Container
Native
- Run the following command to get the name of the file system on your Red Hat OpenShift Container Platform
cluster:
oc exec $(oc get pod -o name -l app.kubernetes.io/name=core \
-n ibm-spectrum-scale |head -1) -n ibm-spectrum-scale \
-c gpfs -- mmremotecluster show
To set this environment variable, run the following command.
export FILE_SYSTEM_NAME=<file-system-name>
Replace
<file-system-name> with the appropriate value for your
environment.
|
REMOTE_STORAGE_CLUSTER_ID |
Specify the ID of the remote storage cluster.
- IBM Spectrum Fusion
- Run the following command to get the cluster
ID:
oc get daemons ibm-spectrum-scale -n ibm-spectrum-scale \
-o jsonpath='{.status.clusterID}'
- IBM Spectrum Scale Container
Native
- Run the following command on the remote IBM Spectrum
Scale cluster to get the cluster
ID:
mmlscluster
To set this environment variable, run the following command.
export REMOTE_STORAGE_CLUSTER_ID=<cluster-id>
Replace <cluster-id> with the appropriate value for your environment.
|
- Create the storage class.
The following sample includes the minimum required information for the storage class. Review
Storage Class in the IBM Spectrum Scale Container
Native documentation for additional options.
cat <<EOF |oc apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ibm-spectrum-scale-sc
provisioner: spectrumscale.csi.ibm.com
parameters:
volBackendFs: "${FILE_SYSTEM_NAME}"
clusterId: "${REMOTE_STORAGE_CLUSTER_ID}"
permissions: "777" # The permissions must be set to 777. Do not change this setting.
reclaimPolicy: Delete
allowVolumeExpansion: true
EOF
What to do next
Now that you've created the storage class, you are ready to complete Setting up projects (namespaces) on Red Hat OpenShift Container Platform.