Red Hat provides OpenShift container storage as a method to provision storage to pods using local devices in compute nodes.
Prerequisites include:
Perform these steps in all Red Hat Enterprise Linux-based compute nodes.
[root@compute-3 ~]# subscription-manager repos --enable=rhel-7-server-rpms
Repository 'rhel-7-server-rpms' is enabled for this system.
[root@compute-3 ~]# subscription-manager repos --enable=rhel-7-server-extras-rpms
Repository 'rhel-7-server-extras-rpms' is enabled for this system.
[root@compute-3 ~]# yum install -y policycoreutils container-selinux
[root@compute-3 ~]# setsebool -P container_use_cephfs on
Note: Project openshift-storage is created automatically. Installed operators are listed under Operators > Installed Operators.
[core@csah ocs]$ oc get pods -n openshift-storage -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
noobaa-operator-55c779bc76-tb4dr 1/1 Running 0 3m34s 10.131.1.232 compute-2.example.com <none> <none>
ocs-metrics-exporter-b5df77d68-bs5wg 1/1 Running 0 3m34s 10.129.2.54 compute-3.example.com <none> <none>
ocs-operator-6dfd764558-lwzqq 1/1 Running 0 3m34s 10.128.3.154 compute-1.example.com <none> <none>
rook-ceph-operator-64cc69dbcc-gf29x 1/1 Running 0 3m34s 10.131.1.231 compute-2.example.com <none> <none>
Note: Project openshift-local-storage is created automatically. Installed operators are listed under Operators -> Installed Operators.
[core@csah ocs]$ oc get pods -n openshift-local-storage -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
local-storage-operator-967d7f899-gl2qw 1/1 Running 0 6m33s 10.128.3.159 compute-1.example.com <none> <none>
A volume set is created by default by adding all available disks under all compute nodes.
Note: In our deployment, we used only SSD/NVMe drives by setting the size to 700 G to 900 G.
[core@csah ocs]$ oc get sc | grep <storage class name>
Note: The ocs-storagecluster-ceph-rbd, ocs-storagecluster-ceph-rgw, ocs-storagecluster-cephfs storage classes are created by default.
[core@csah ocs]$ oc get pods -n openshift-storage
[core@csah ocs]$ oc get pods -n openshift-local-storage
The following steps create a PVC by using ocs-storagecluster-cephfs and ocs-storagecluster-ceph-rbdL:
[core@csah ~]$ oc create -f <YAML file>
[core@csah ocs]$ oc get pvc -n ocs
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
ocsfspvc Bound pvc-44d3a805-0e6b-48b1-a8d6-0ab6c56e1975 10Gi RWX ocs-storagecluster-cephfs 29s
[core@csah ~]$ oc create -f <YAML file>
[core@csah ocs]$ oc exec -it -n ocs ocsfspod -- df -h /usr/share/nginx/html
Filesystem Size Used Avail Use% Mounted on
172.30.64.242:6789,172.30.152.143:6789,172.30.10.82:6789:/volumes/csi/csi-vol-5799b028-4e0f-11eb-b2ab-0a580a8003a8/1021f0b6-5b98-4d33-81e6-cdcecd668345 10G 0 10G 0% /usr/share/nginx/html
[core@csah ~]$ oc create -f <YAML file>
[core@csah ocs]$ oc get pvc ocsrbdpvc -n ocs
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
ocsrbdpvc Bound pvc-7742925d-8ecb-4d49-8b4b-00313d8d7c85 10Gi RWO ocs-storagecluster-ceph-rbd 27s
[core@csah ~]$ oc create -f <YAML file>
[core@csah ocs]$ oc exec -it ocsrbdpod -n ocs -- df -h /usr/share/nginx/html
Filesystem Size Used Avail Use% Mounted on /dev/rbd1 9.8G 37M 9.8G 1% /usr/share/nginx/html