Configuration: Storage-admin tasks
The following resources must be configured by a storage administrator:
-
Log into the NetApp ONTAP cluster as admin.
-
Navigate to Storage > Storage VMs and click Add. Create two SVMs, one for project-1 and the other for project-2, by providing the required details. Also create a vsadmin account to manage the SVM and its resources.
-
Log into the Red Hat OpenShift cluster as the storage administrator.
-
Create the backend for project-1 and map it to the SVM dedicated to the project. NetApp recommends using the SVM's vsadmin account to connect the backend to SVM instead of using the ONTAP cluster administrator.
cat << EOF | tridentctl -n trident create backend -f { "version": 1, "storageDriverName": "ontap-nas", "backendName": "nfs_project_1", "managementLIF": "172.21.224.210", "dataLIF": "10.61.181.224", "svm": "project-1-svm", "username": "vsadmin", "password": "NetApp123" } EOF
We are using the ontap-nas driver for this example. Use the appropriate driver when creating the backend based on the use case. |
We assume that Trident is installed in the trident project. |
-
Similarly create the Trident backend for project-2 and map it to the SVM dedicated to project-2.
-
Next, create the storage classes. Create the storage class for project-1 and configure it to use the storage pools from backend dedicated to project-1 by setting the storagePools parameter.
cat << EOF | oc create -f - apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: project-1-sc provisioner: csi.trident.netapp.io parameters: backendType: ontap-nas storagePools: "nfs_project_1:.*" EOF
-
Likewise, create a storage class for project-2 and configure it to use the storage pools from backend dedicated to project-2.
-
Create a ResourceQuota to restrict resources in project-1 requesting storage from storageclasses dedicated to other projects.
cat << EOF | oc create -f - kind: ResourceQuota apiVersion: v1 metadata: name: project-1-sc-rq namespace: project-1 spec: hard: project-2-sc.storageclass.storage.k8s.io/persistentvolumeclaims: 0 EOF
-
Similarly, create a ResourceQuota to restrict resources in project-2 requesting storage from storageclasses dedicated to other projects.