|
| 1 | +--- |
| 2 | +title: SODA Integration with Vendor CSI Drivers via SODA CSI Plug-N-Play |
| 3 | +menuTitle: "SODA CSI Plug-N-Play" |
| 4 | +description: "A guide for integrating SODA with Vendor CSI Driver via unified Plugin." |
| 5 | +weight: 10 |
| 6 | +disableToc: false |
| 7 | +tags: ["integration guide", "kubernetes csi", "plug-n-play", "unified plugin"] |
| 8 | +--- |
| 9 | + |
| 10 | +SODA CSI Plug-N-Play is a mechanism by which users can use the heterogeneous storage vendors in a unified way, |
| 11 | +Users need to define the requirements while creating SODA Profile, |
| 12 | +Users need to use this profile ID while creating the PVC's in the Kubernetes, |
| 13 | +the soda-csi-provisioner will automatically select the vendor csi-driver and help in |
| 14 | +provisioning the Volumes for Pods. |
| 15 | + |
| 16 | +## Prerequisite |
| 17 | + - An installation of Kubernetes (V1.17+) |
| 18 | + - SODA installation (you can refer to quick start guide over [here](https://docs.sodafoundation.io/soda-gettingstarted/installation-using-ansible/)), you need to change the ports of etcd in osdb.yaml while installing SODA on an existing K8s environment as the ports cause conflict with k8s etcd. |
| 19 | + |
| 20 | +## Selecting the vendor CSI driver |
| 21 | +You can select the CSI driver supported by SODA Plug-N-Play from [here](https://docs.sodafoundation.io/guides/user-guides/nbp/csi-pnp/) Once selected follow the instruction |
| 22 | +given in the document to deploy the CSI driver in K8s. |
| 23 | + |
| 24 | +##### For this example we are selecting the [OpenEBS LVM CSI Driver](https://github.com/openebs/lvm-localpv). |
| 25 | + |
| 26 | +```go |
| 27 | +kubectl create -f https://raw.githubusercontent.com/asifdxtreme/soda-ucp/main/examples/openebs/driver/lvm-operator.yaml |
| 28 | +``` |
| 29 | +We need to do the additional step to make the lvm group for this plugin |
| 30 | +```go |
| 31 | +truncate -s 1024G /tmp/disk.img |
| 32 | +sudo losetup -f /tmp/disk.img --show |
| 33 | +``` |
| 34 | +Create the Volume group on all the nodes, which will be used by the LVM Driver for provisioning the volumes |
| 35 | + |
| 36 | +```go |
| 37 | +sudo pvcreate /dev/loop0 |
| 38 | +sudo vgcreate lvmvg /dev/loop0 |
| 39 | +``` |
| 40 | + |
| 41 | + |
| 42 | +## Creating Profile in SODA |
| 43 | +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). |
| 44 | + |
| 45 | +```go |
| 46 | +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"}}' |
| 47 | + |
| 48 | +``` |
| 49 | + |
| 50 | +## Attach information of ProfileID in Storage Class |
| 51 | +Once the Profile ID is created then we need to create a Storage Class in K8s. |
| 52 | +```go |
| 53 | + |
| 54 | +apiVersion: storage.k8s.io/v1 |
| 55 | +kind: StorageClass |
| 56 | +metadata: |
| 57 | + name: openebs-lvmsc-soda |
| 58 | +allowVolumeExpansion: true |
| 59 | +parameters: |
| 60 | + volgroup: "lvmvg" |
| 61 | + profile: a82980d3-1030-41e5-95f0-b2db5a0c065d ## SODA PROFILE ID |
| 62 | +provisioner: soda-csi |
| 63 | +allowedTopologies: |
| 64 | +- matchLabelExpressions: |
| 65 | + - key: kubernetes.io/hostname |
| 66 | + values: |
| 67 | + - node-12340 ## NODE NAME ON WHICH PROVISIONING NEEDS TO BE DONE |
| 68 | +``` |
| 69 | + |
| 70 | +## Deploy an App with pvc |
| 71 | + |
| 72 | +```go |
| 73 | +kubectl create -f https://raw.githubusercontent.com/asifdxtreme/soda-ucp/main/examples/openebs/app/app.yaml |
| 74 | +``` |
| 75 | + |
0 commit comments