Automatic Discovery and Provisioning of Local Persistent Volume (PV) in OpenShift - Part 2
Overview
In Part 1, we saw that Local Storage Operator (LSO) simplifies the overall Local PV provisioning process by automatically discovering Local disks and auto-provisioning PVs on them. StorageClass is created automatically and readily available for Persistent Volume consumption inside pod. This is still Tech Preview feature.
Scenario
In this blog, I will cover following scenarios:-
Environment
In Part 1, LSO created the following Local PVs and StorageClass (localblock) automatically. We will start from there.
Now, let us mount Local PV for PostgreSQL database application pod.
Steps
Scenario 1
Mounting Local PVs for Applications
Initially postgresql pod is using an empty directory for its storage and there is no mount directory "/var/lib/pgsql/data" & PVC exists.
Let us update OpenShift deploymentconfig/postgresql object and add Persistent Volume Claim (PVC) using localblock StorageClass. We want to mount Local PV on /var/lib/pgsql/data directory inside postgresql pod.
PVC using StorageClass "localblock" has been bound successfully to Local PV and volume also mounted inside the /var/lib/pgsql/data directory of postgresql pod.
Scenario 2
LSO automated discovery and Local PV provisioning for newly attached/added storage disks
First, let us add a new disk on the worker node. Prior doing that, let us see current list of disks present on worker nodes, as shown below, only vd{b,c,d} disks are present.
Check the current number of PVs. we can see 6 PV as expected against total 6 disks attached on both worker nodes (3 disks on each worker node)
Let us add 1 new disk on worker1 node and check for its automatic discovery and Local PV provisioning by LSO.
We can see storage Disk vde automatically discovered on worker1 node.
we can see Local PV on newly auto-discovered disk (vde) has been provisioned automatically by LSO.
We can see device name vde provisioned by LSO and appearing in Annotations key.
Conclusion
In this part, we saw that OpenShift LSO make it easier for containerized applications to consume Local storage PVs dynamically/automatically using Local StorageClass. We also saw that OpenShift LSO can automatically discover newly added/attached Local disks on Worker nodes and auto-provision Local PVs on them and thus simplifying Day-2 IT Operations as well.
Please feel free to play with OpenShift Local Storage Operator and share your feedback!! For more details, please refer following links:-
Architecture & Technical Sales Leader at Red Hat
2 年informative. Thanks! Anuvrat
Manager-Solution Architecture at Red Hat
2 年Very informative reading. Thanks Anuvrat
General Manager - AI platform solution (NVIDIA/AMD), Cloud Engineering, Edge Computing, Openshift, Openstack.
2 年That’s amazing Anuvrat ??
Hybrid Cloud & Ansible Automation Expert | Consulting Practice Lead | Openshift | Multicloud | Ceph | RHCE,RHCSS,RHCA
2 年Thanks for completing 2nd part for LSO Operator... Great information, very helpful..!!