4.6. OpenStack Manila CSI Driver Operator


4.6.1. Overview

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.

4.6.2. Installing the Manila CSI Driver Operator

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.

Prerequisites

  • You have access to the OpenShift Container Platform web console.
  • The underlying Red Hat OpenStack Platform (RHOSP) infrastructure cloud deploys Manila serving NFS shares.

Procedure

To install the Manila CSI Driver Operator from the web console, follow these steps:

  1. Log in to the OpenShift Container Platform web console.
  2. Navigate to Operators OperatorHub.
  3. Type Manila CSI Driver Operator into the filter box to locate the Operator.
  4. Click Install.
  5. On the Install Operator page, select openshift-manila-csi-driver-operator from the Installed Namespace drop-down menu.
  6. 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.
  7. Click Install.

Once finished, the Manila CSI Driver Operator is listed in the Installed Operators section of the web console.

4.6.3. Installing the OpenStack Manila CSI driver

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.

Prerequisites

  • The Manila CSI Driver Operator has been installed.
  • Access to the OpenShift Container Platform web console or command-line interface (CLI).

UI procedure

To install the Manila CSI driver from the web console, complete the following steps:

  1. Log in to the OpenShift Container Platform web console.
  2. Navigate to Operators Installed Operators.
  3. Locate the Manila CSI Driver Operator from the list and click on the Operator link.
  4. Create the driver:

    1. From the Details tab, click Create Instance.
    2. Optional: Select YAML view to make modifications, such as adding notations, to the ManilaDriver object template.
    3. Click Create to finalize.

      重要

      Renaming the cluster and specifying a certain namespace are not supported functions.

CLI procedure

To install the Manila CSI driver from the CLI, complete the following steps:

  1. Create an object YAML file, such as maniladriver.yaml, to define the ManilaDriver:

    Example 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.
  2. 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).

Verification

  1. 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
  2. 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

4.6.4. Dynamically provisioning Manila CSI volumes

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.

Prerequisites

  • 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.

Procedure (UI)

To dynamically create a Manila CSI volume using the web console:

  1. In the OpenShift Container Platform console, click Storage Persistent Volume Claims.
  2. In the persistent volume claims overview, click Create Persistent Volume Claim.
  3. Define the required options on the resulting page.

    1. Select the appropriate StorageClass.
    2. Enter a unique name for the storage claim.
    3. Select the access mode to specify read and write access for the PVC you are creating.

      重要
      • 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 RWO mode if you want to prevent additional Pods from being dynamically provisioned.
  4. Define the size of the storage claim.
  5. Click Create to create the persistent volume claim and generate a persistent volume.

Procedure (CLI)

To dynamically create a Manila CSI volume using the command-line interface (CLI):

  1. Create and save a file with the PersistentVolumeClaim object described by the following YAML:

    pvc-manila.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.
  2. 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.

  3. 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.

4.6.5. Uninstalling the Manila CSI Driver Operator

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.

Prerequisites

  • Access to the OpenShift Container Platform web console.

Procedure

To uninstall the Manila CSI Driver Operator from the web console:

  1. Log in to the web console.
  2. Navigate to Storage Persistent Volume Claims.
  3. Select any PVCs that are in use by the Manila CSI Driver Operator and click Delete.
  4. 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.
  5. On the right-hand side of the Installed Operators details page, select Uninstall Operator from the Actions drop-down menu.
  6. 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.

Additional resources

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.