Create Storage Class with Cinder Backend
#
Select your clusterStorage Classes
from Storage dropdown menu#
Select Import YAML
#
Click on #
Paste the code and click importapiVersion: storage.k8s.io/v1kind: StorageClassmetadata: name: cinderprovisioner: kubernetes.io/cinderreclaimPolicy: Deleteparameters: availability: nova
#
Now we able to use Cinder Volume as storage class#
Create a PVC#
Navigate to your cluster default projectAdd Volume
#
Switch to Volumes tab and click #
Select cinder from Storage Class and Create#
Check point- a volume has been created under Project > Volumes > Volumes
#
Create a sample workload with pv/pvcapiVersion: v1kind: Podmetadata: name: my-cinder-pv-pod-1spec: volumes: - name: my-cinder-pv-storage-1 persistentVolumeClaim: claimName: pv containers: - name: task-pv-container-1 image: nginx ports: - containerPort: 80 name: "http-server" volumeMounts: - mountPath: "/usr/share/nginx/html" name: my-cinder-pv-storage-1
#
Enter your workload shell and check up#
Shell: task-pv-container-1root@my-cinder-pv-pod-1:/# lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 40G 0 disk |-sda1 8:1 0 39.9G 0 part /etc/hosts|-sda14 8:14 0 4M 0 part `-sda15 8:15 0 106M 0 part sdb 8:16 0 10G 0 disk /usr/share/nginx/htmlroot@my-cinder-pv-pod-1:/# cd /usr/share/nginx/html/root@my-cinder-pv-pod-1:/usr/share/nginx/html# lslost+foundroot@my-cinder-pv-pod-1:/usr/share/nginx/html# echo "bigstack.co" >> index.htmlroot@my-cinder-pv-pod-1:/usr/share/nginx/html# cat index.html bigstack.coroot@my-cinder-pv-pod-1:/usr/share/nginx/html#
#
Check point- The cinder volume has been attached to your cluster