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 Storage
Fusion or IBM Storage Scale
Container Native cluster.
- IBM Storage
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 Storage 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 Storage
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 Storage Scale
Container Native
- Run the following command on the remote IBM Storage
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 Storage 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}"
shared: "true"
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.