Cinder CSI

Cinder is an Openstack cloud storage service that can be used to provision block storage to Kubernetes Nodes running within an environment with Openstack Cinder. To use Cinder a Kubernetes storage class and the required Cinder CSI driver needs to be installed within the Kubernetes Clusters along with an encrypted Openstack RC configuration for accessing the OpenStack Cloud.

The steps below will take you through cloning the Cinder CSI GitHub repository and installing the driver. Please note, Cinder CSI may also be install using helm charts.

To install the Cinder CSI driver you must have GitHub and Kubectl installed on the host that will be used to access the cluster.

Install Cinder CSI Driver

The first step is to clone the cinder repository from GitHub to a host that that has Kubectl installed and can access your cluster.

Bash
Copy

Once the repository has been cloned a new Kubernetes Secret must be created that contains the Openstack RC for connecting to the Openstack cloud.

Within the cloned directory navigate to the manifest files for the CSI driver cloud-provider-openstack/manifests``cinder-csi-plugin/. In the the CSI driver folder you will need to create the secret which contains the rc file of our openstack cloud. Once the file has been created it needs to be converted to base64.

Create the Openstack RC file by running the command below:

Bash
Copy

Save and close the file and then use the command below to encrypt your file with base64 so it can be use as a secret.

Bash
Copy

Use VI or VIM to copy the contents of the encoded Openstack RC configuration and add the string into the data field of the csi-secret-cinderplugin.yamlfile.

YAML
Copy

The secret can now be added to the Kubernetes Cluster. To do this apply the cs-secret-cinderplugin.yaml file using Kubectl , this will create a secret name cloud-config in kube-system namespace.

Bash
Copy

The next step is to apply the remaining manifest files to deploy the csi-cinder controller and related plugins.

The manifests will create a set of cluster roles, cluster role bindings, and statefulsets to communicate with openstack and the Cinder service.

Apply all of the manifest using Kubectl Apply at the parent directory of the cloned Cinder repository.

Bash
Copy

To validate the CSI driver is installed and running runKubectl get pods -n kube-systemand look for the cinder pods below.

Bash
Copy

To get information about CSI Drivers running in a cluster

Bash
Copy

Create Cinder Storage Class

Once the the Cinder CSI driver is installed a Storage Class needs to be setup to enable consumption of the driver. Follow the steps below to setup a storage class.

  1. Log into your Platform9 SaaS Management Plane
  2. Navigate to Storage and click Add Storage Class
  3. Select the target cluster, enter a name, select if the storage class should be the cluster defused and enter cinder.csi.openstack.orgas the provisioner
  4. Click next,
  5. Review the YAML file before applying it to the cluster.

Example Cinder Storage Class.

YAML
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard