SODA CSI Plug-N-Play is a mechanism by which users can use the heterogeneous storage vendors in a unified way, Users need to define the requirements while creating SODA Profile, Users need to use this profile ID while creating the PVC’s in the Kubernetes, the soda-csi-provisioner will automatically select the vendor csi-driver and help in provisioning the Volumes for Pods.
You can select the CSI driver supported by SODA Plug-N-Play from here Once selected follow the instruction given in the document to deploy the CSI driver in K8s.
If there are more than one CSI driver from the same storage vendor, it should be deployed in a different namespaces to avoid the soda-csi lock conflicts.
example : OPENEBS-LVM CSI driver in Kube-system namespace and OPENEBS-ZFS CSI driver in Kube-system-zfs namespace.
CSI drivers from different storage vendors can be deployed in the same namespace without having any conflict.
example : CEPH-RBD CSI driver and IBM CSI driver both in the default namespace and didn’t notice any soda-csi lock conflict issue.
kubectl create -f https://raw.githubusercontent.com/asifdxtreme/soda-ucp/main/examples/openebs/driver/lvm-operator.yaml
We need to do the additional step to make the lvm group for this plugin
truncate -s 1024G /tmp/disk.img
sudo losetup -f /tmp/disk.img --show
Create the Volume group on all the nodes, which will be used by the LVM Driver for provisioning the volumes
sudo pvcreate /dev/loop0
sudo vgcreate lvmvg /dev/loop0
We need to create a Profile in SODA which will have the information of csi driver which needs to be used(eventually this step will be automatically done by SODA).
osdsctl profile create '{"name": "openebs-profile-soda","storageType": "block","description": "string","provisioningProperties": {"dataStorage": {"recoveryTimeObjective": 10,"provisioningPolicy": "Thick","compression": false,"deduplication": false,"characterCodeSet": "ASCII","maxFileNameLengthBytes": 255,"storageAccessCapability": ["Read"] },"ioConnectivity": {"accessProtocol": "iscsi","maxIOPS": 150,"minIOPS": 50,"maxBWS": 5,"minBWS": 1,"latency": 1}},"replicationProperties": {},"snapshotProperties": {},"dataProtectionProperties": { },"customProperties": {"driver": "local.csi.openebs.io"}}'
Once the Profile ID is created then we need to create a Storage Class in K8s.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-lvmsc-soda
allowVolumeExpansion: true
parameters:
volgroup: "lvmvg"
profile: a82980d3-1030-41e5-95f0-b2db5a0c065d ## SODA PROFILE ID
provisioner: soda-csi
allowedTopologies:
- matchLabelExpressions:
- key: kubernetes.io/hostname
values:
- node-12340 ## NODE NAME ON WHICH PROVISIONING NEEDS TO BE DONE
kubectl create -f https://raw.githubusercontent.com/asifdxtreme/soda-ucp/main/examples/openebs/app/app.yaml