Creating a Storage Class
Create a storage class on the Kubernetes management node, including configuring the csi-rbd-sc.yaml file.
- Create a csi-rbd-sc.yaml file.
vi csi-rbd-sc.yaml
- Press i to enter the insert mode and add the following content to the csi-rbd-sc.yaml file: Set clusterID to the FSID obtained in 2.
--- apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: csi-rbd-sc provisioner: rbd.csi.ceph.com parameters: clusterID: c2c76878-2c57-4b1c-ae9c-1cda797a1753 pool: kubernetes csi.storage.k8s.io/provisioner-secret-name: csi-rbd-secret csi.storage.k8s.io/provisioner-secret-namespace: default csi.storage.k8s.io/node-stage-secret-name: csi-rbd-secret csi.storage.k8s.io/node-stage-secret-namespace: default csi.storage.k8s.io/controller-expand-secret-name: csi-rbd-secret csi.storage.k8s.io/controller-expand-secret-namespace: default imageFeatures: layering reclaimPolicy: Delete allowVolumeExpansion: true mountOptions: - discard
- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Use the YAML file to create a storage class.
kubectl apply -f csi-rbd-sc.yaml
Parent topic: Integrating Ceph with Kubernetes