apiVersion: csi.openshift.io/v1alpha1
kind: ManilaDriver
metadata:
name: cluster (1)
OpenShift Container Platform is capable of provisioning persistent volumes (PVs) using the Container Storage Interface (CSI) driver for the OpenStack Manila shared file system service.
Familiarity with PVs, persistent volume claims (PVCs), dynamic provisioning, and RBAC authorization is recommended.
Before PVCs can be created, you must install the Manila CSI Driver Operator. The Operator creates the required storage classes for all available Manila share types needed for dynamic provisioning.
After the Operator is installed, you must also create the ManilaDriver Custom Resource (CR) that is required in the OpenShift Container Platform cluster.
The Manila Container Storage Interface (CSI) Driver Operator is not installed in OpenShift Container Platform by default. Use the following procedure to install and configure this Operator to enable the OpenStack Manila CSI driver in your cluster.
You have access to the OpenShift Container Platform web console.
The underlying Red Hat OpenStack Platform (RHOSP) infrastructure cloud deploys Manila serving NFS shares.
To install the Manila CSI Driver Operator from the web console, follow these steps:
Log in to the OpenShift Container Platform web console.
Navigate to Operators → OperatorHub.
Type Manila CSI Driver Operator into the filter box to locate the Operator.
click Install.
On the Install Operator page, select openshift-manila-csi-driver-operator from the Installed Namespace drop-down menu.
Adjust the values for Update Channel and Approval Strategy to the values that you want. The only supported Installation Mode is All namespaces on the cluster.
click Install.
Once finished, the Manila CSI Driver Operator is listed in the Installed Operators section of the web console.
The OpenStack Manila Container Storage Interface (CSI) driver is a custom resource (CR) that enables you to create and mount OpenStack Manila shares. It also supports creating snapshots, and recovering shares from snapshots.
The driver is not installed in OpenShift Container Platform by default, and must be installed after the Manila CSI Driver Operator has been installed.
The Manila CSI Driver Operator has been installed.
Access to the OpenShift Container Platform web console or command-line interface (cli).
To install the Manila CSI driver from the web console, complete the following steps:
Log in to the OpenShift Container Platform web console.
Navigate to Operators → Installed Operators.
Locate the Manila CSI Driver Operator from the list and click on the Operator link.
Create the driver:
From the Details tab, click Create Instance.
Optional: Select YAML view to make modifications, such as adding notations, to the ManilaDriver object template.
click Create to finalize.
Renaming the cluster and specifying a certain namespace are not supported functions. |
To install the Manila CSI driver from the cli, complete the following steps:
Create an object YAML file, such as maniladriver.yaml
, to define the ManilaDriver:
apiVersion: csi.openshift.io/v1alpha1
kind: ManilaDriver
metadata:
name: cluster (1)
1 | Renaming the cluster and specifying a certain namespace are not supported functions. |
Create the ManilaDriver CR object in your OpenShift Container Platform cluster by specifying the file you created in the previous step:
$ oc create -f maniladriver.yaml
When the Operator installation is finished, the Manila CSI driver is deployed on OpenShift Container Platform for dynamic provisioning of RWX persistent volumes on Red Hat OpenStack Platform (RHOSP).
Verify that the ManilaDriver CR was created successfully by entering the following command:
$ oc get all -n openshift-manila-csi-driver
NAME READY STATUS RESTARTS AGE
pod/csi-nodeplugin-nfsplugin-lzvpm 1/1 Running 0 18h
pod/csi-nodeplugin-nfsplugin-slvg2 1/1 Running 0 18h
pod/csi-nodeplugin-nfsplugin-xmps9 1/1 Running 0 18h
pod/openstack-manila-csi-controllerplugin-7d4f5d985b-mw4x5 3/3 Running 0 17h
pod/openstack-manila-csi-nodeplugin-6xchs 2/2 Running 0 18h
pod/openstack-manila-csi-nodeplugin-bkcmz 2/2 Running 0 18h
pod/openstack-manila-csi-nodeplugin-rlpps 2/2 Running 0 18h
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
daemonset.apps/csi-nodeplugin-nfsplugin 3 3 3 3 3 18h
daemonset.apps/openstack-manila-csi-nodeplugin 3 3 3 3 3 18h
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/openstack-manila-csi-controllerplugin 1/1 1 1 18h
NAME DESIRED CURRENT READY AGE
replicaset.apps/openstack-manila-csi-controllerplugin-7d4f5d985b 1 1 1 17h
Verify that the storage class was created successfully by entering the following command:
$ oc get storageclasses | grep -E "NAME|csi-manila-"
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
csi-manila-gold manila.csi.openstack.org Delete Immediate false 18h
OpenShift Container Platform installs a StorageClass for each available Manila share type.
The YAML files that are created are completely decoupled from Manila and from its Container Storage Interface (CSI) plug-in. As an application developer, you can dynamically provision ReadWriteMany (RWX) storage and deploy Pods with applications that safely consume the storage using YAML manifests. You can also provision other access modes, such as ReadWriteOnce (RWO).
You can use the same Pod and persistent volume claim (PVC) definitions on-premise that you use with OpenShift Container Platform on AWS, GCP, Azure, and other platforms, with the exception of the storage class reference in the PVC definition.
Red Hat OpenStack Platform (RHOSP) is deployed with appropriate Manila share infrastructure so that it can be used to dynamically provision and mount volumes in OpenShift Container Platform.
To dynamically create a Manila CSI volume using the web console:
In the OpenShift Container Platform console, click Storage → Persistent Volume Claims.
In the persistent volume claims overview, click Create Persistent Volume Claim.
Define the required options on the resulting page.
Select the appropriate StorageClass.
Enter a unique name for the storage claim.
Select the access mode to specify read and write access for the PVC you are creating.
|
Define the size of the storage claim.
click Create to create the persistent volume claim and generate a persistent volume.
To dynamically create a Manila CSI volume using the command-line interface (cli):
Create and save a file with the PersistentVolumeClaim
object described by the following YAML:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-manila
spec:
accessModes: (1)
- ReadWriteMany
resources:
requests:
storage: 10Gi
storageClassName: csi-manila-gold (2)
1 | Use RWX if you want the persistent volume (PV) that fulfills this PVC to be mounted to multiple Pods on multiple nodes in the cluster. Use ReadWriteOnce (RWO) mode to prevent additional Pods from being dynamically provisioned. |
2 | The name of the storage class that provisions the storage back end. Manila StorageClasses are provisioned by the Operator and have the csi-manila- prefix. |
Create the object you saved in the previous step by running the following command:
$ oc create -f pvc-manila.yaml
A new PVC is created.
To verify that the volume was created and is ready, run the following command:
$ oc get pvc pvc-manila
The pvc-manila
shows that it is Bound
.
You can now use the new PVC to configure a Pod.
Before you uninstall the Manila Container Storage Interface (CSI) Driver Operator, you must delete all persistent volume claims (PVCs) that are in use by the Operator.
Access to the OpenShift Container Platform web console.
To uninstall the Manila CSI Driver Operator from the web console:
Log in to the web console.
Navigate to Storage → Persistent Volume Claims.
Select any PVCs that are in use by the Manila CSI Driver Operator and click Delete.
From the Operators → Installed Operators page, scroll or type Manila CSI into the Filter by name field to find the Operator. Then, click on it.
On the right-hand side of the Installed Operators details page, select Uninstall Operator from the Actions drop-down menu.
When prompted by the Uninstall Operator window, click the Uninstall button to remove the Operator from the namespace. Any applications deployed by the Operator on the cluster will need to be cleaned up manually.
Once finished, the Manila CSI Driver Operator is no longer listed in the Installed Operators section of the web console.