CSI Openstack Module (CSI Cinder)

In the Shturval platform, the CSI Openstack Module allows you to use cloud storage of the Openstack virtualization platform. The module is the Cinder CSI driver and is responsible for allocating a persistent volume (PersistentVolume), mounting and disconnecting the volume from the virtual machine.

Installation in a cluster

The CSI Openstack module is not a critical service for the operation of the Shturval platform. If CSI integration was enabled when creating a cluster with Openstack provider, the CSI Openstack Module will be installed automatically and no manual configuration will be required.

To enable the module in the created cluster, Openstack/VK Cloud/Selectel provider must allow CSI installation. To install the module in the platform’s graphical interface, go to the Services and Repositories section on the Available Charts page. In the shturval tab, find the CSI Openstack module (shturval-capos-csi) and proceed to install.

Select the chart version and namespace shturval-capos-csi. If there is no namespace with the same name, create it by clicking “+ Create namespace” in the Namespace field in the drop-down list.

When installing the module, StorageClasses with the names csi-cinder-sc-delete and csi-cinder-sc-retain will be added to the cluster. In the Service Specification block, specify the default StorageClass, as shown in the example below.

Customvalues example
storageClass:
  delete:
      isDefault: true 
ParameterDescriptionData typeExample
storageClass.delete.isDefaultSets the default use of StorageClass with delete cleanup policy (automatic PV deletion)booleantrue

Complete the module installation by clicking Save.

When the module is installed, for csi to work correctly, you will need to create a Secret in the shturval-capos-csi namespace with the provider connection configuration data, as in the provider instance with which the cluster was created. To do this:

  1. Create the provider connection configuration.
ISP connection configuration example
[Global]
auth-url=<your-parameter-value>
username=<your-parameter-value>
password=<your-parameter-value>
region=<your-parameter-value>
tenant-id=<your-parameter-value>
domain-name=<your-parameter-value>
[BlockStorage]
ignore-volume-microversion=true
ParameterDescriptionExample
auth-urlAuthentication Server URLhttps://example.ru:35357/v3/
usernameUsername to connectusername
passwordUser password for connectionmy-password
regionRegion nameRegionOne
tenant-idProject ID (project_id)projectid
domain-nameUser domain nameusers
  1. In the cluster graphical interface, go to namespace shturval-capos-csi, then to the Storage section on the Secrets page and create a secret:
    • set the name cloud-config;
    • select Opaque type;
    • add a key named cloud.conf, in the value of which indicate the prepared configuration.
Example of created cloud-config

apiVersion: v1
kind: Secret
type: Opaque
data:
  cloud.conf: W0dsb2JhbF0KYXV0aC11cmw9PNCy0LDRiNC1INC30L3QsNGH0LXQvdC40LUg0L/QsNGA0LDQvNC10YLRgNCwPgp1c2VybmFtZT080LLQsNGI0LUg0LfQvdCw0YfQtdC90LjQtSDQv9Cw0YDQsNC80LXRgtGA0LA+CnBhc3N3b3JkPTzQstCw0YjQtSDQt9C90LDRh9C10L3QuNC1INC/0LDRgNCw0LzQtdGC0YDQsD4KcmVnaW9uPTzQstCw0YjQtSDQt9C90LDRh9C10L3QuNC1INC/0LDRgNCw0LzQtdGC0YDQsD4KdGVuYW50LWlkPTzQstCw0YjQtSDQt9C90LDRh9C10L3QuNC1INC/0LDRgNCw0LzQtdGC0YDQsD4KZG9tYWluLW5hbWU9PNCy0LDRiNC1INC30L3QsNGH0LXQvdC40LUg0L/QsNGA0LDQvNC10YLRgNCwPgpbQmxvY2tTdG9yYWdlXQppZ25vcmUtdm9sdW1lLW1pY3JvdmVyc2lvbj10cnVl
metadata:
  name: cloud-config
  namespace: shturval-capos-csi

To further allocate PersistentVolumes in StorageClass csi-cinder-sc-delete, csi-cinder-sc-retain by default, you need to change the StorageClass local-path settings. To do this in the graphical interface:

  • go to the StorageClasses page of the Storage section;
  • open the StorageClass named local-path and go to the Labels and Annotations tab;
  • remove the storageclass.kubernetes.io/is-default-class:true annotation and save the changes.

Pay attention!

  1. For the CSI Openstack Module to work, the Cluster Network Management Module (shturval-networking) must be running in the cluster.
  2. When using cloud storage of the Openstack virtualization platform, if you delete a cluster with the OpenStack provider, you will need to manually delete the PVC in the virtualization platform.
  3. Only new PersistentVolumeClaim (PVC) will be allocated a PersistentVolume belonging to the default StorageClass (csi-cinder-sc-delete, csi-cinder-sc-retain).