CSI driver implementation for OpenEBS CStor storage engine.
Container Storage Interface (CSI) is an initiative to unify the storage interface of Container Orchestrator Systems (COs) like Kubernetes, Mesos, Docker swarm, cloud foundry, etc…
The OpenEBS CStor CSI Driver for Kubernetes allows you to use a Container Storage Provider to perform data management operations on storage resources.Currently OpenEBS CStor CSI Driver is in Beta
The current implementation supports the following for CStor Volumes:
Provisioning and De-provisioning with ext4,xfs filesystems
Snapshots and clones
Volume Expansion
Volume Metrics
In this post you will see :
How to deploy OpenEBS CSI Driver
Creating a Storage Class
Provisioning a Persistent Volume Claim
Deploying a SQL Server instance on an OpenEBS storage
Expand volume
Prerequisites
Before you get started, you’ll need to have these things:
Kubernetes 1.17+ with RBAC enabled
You will need to have OpenEBS Version 1.12 or higher installed
iSCSI PV support in the underlying infrastructure
CStor CSI driver operates on the cStor Pools provisioned using the new schema called CSPC
Storage disk available in each workers nodes
Infra
Initial setup
You must first provision a CStorPoolCluster if you have not done so before.
For our example we will provision a stripe pool on two nodes.A minimum of 3 replicas (on 3 nodes) is recommended for high-availability.
Modify CSPC to add your node selector for the node where you want to provision the pool.
List the nodes with labels:
In this exemple cabernet is picked. Modify the CSPC yaml to use this worker. (Note: Use the value from labels kubernetes.io/hostname=worker1 as this label value and node name could be different in some platforms)
Modify CSPC to add blockdevice attached to the same node where you want to provision the pool.
Finally the CSPC YAML looks like the following :
Apply the modified CSPC YAML.
Check if the pool instances report their status as ‘ONLINE’.
OpenEBS CStor CSI driver comprises of 2 components:
A controller component launched as a StatefulSet, implementing the CSI controller services. The Control Plane services are responsible for creating/deleting the required OpenEBS Volume.
A node component that runs as a DaemonSet, implementing the CSI node services. The node component is responsible for performing the iSCSI connection management and connecting to the OpenEBS Volume.
CStor CSI driver
OpenEBS CStor CSI driver components can be installed by running the following command :
Verify that the OpenEBS CSI Components are installed :
Create a Storage class
Once your pool instances have come online, you can proceed with volume provisioning. Create a storageClass to dynamically provision volumes using OpenEBS CSI provisioner.
One of the most common operations in storage and data management is to expand volume capacity. This feature has been in beta since Kubernetes 1.16 and is now available in the HPE CSI Driver for Kubernetes as a supported feature. In true Kubernetes simplistic fashion the end-user that created the PVC may simply increase the capacity of the PVC specification and the CSI resizer will pick it up and perform all the necessary operations. These operations include increasing the backend storage system volume size, rescanning the multipath device on the host and finally growing the filesystem.This used to be a tedious operation that required a storage admin and Kubernetes admin to satisfy a user requirement, which is very counter-productive.
we will go expand the storage requests for the SQL Server production instance, we will extend the pvc created in the previous step: mssqldata01-cstor-vol-student1
we will then patch the definition of the PVC associate with the command kubectl apply -f patch_file.
Patch file example for PVC mssqldata01-cstor-vol-student1 : patch-csi-pvc.yaml