LVM storage with TopoLVM — full interaction example¶
This applies to Kubernetes and identically to OpenShift Container Platform.
The CSI driver used here is TopoLVM.
0 Preconditions (important)¶
On each node:
- A disk is available (e.g.
/dev/sdb) - An LVM Volume Group exists
Example (done outside Kubernetes):
TopoLVM will only manage existing VGs — it does not create them.
Source: https://topolvm.io/docs/
1 TopoLVM CSI driver (conceptual)¶
TopoLVM is installed via:
- Helm
- or Operator (in OpenShift)
What matters for manifests:
- CSI provisioner name:
You do not manually write the CSI deployment YAML.
Source: https://github.com/topolvm/topolvm
2 StorageClass (TopoLVM)¶
Purpose: tell Kubernetes which VG to use.
Key points¶
topolvm.io/vg-name→ LVM Volume Group name-
WaitForFirstConsumeris critical: -
volume must be created on the node where the Pod runs
Source: https://topolvm.io/docs/storageclass/
4 PersistentVolumeClaim (PVC)¶
Purpose: request an LVM Logical Volume.
What happens now¶
- PVC is Pending
- No PV yet
- No LV created yet
Because:
- provisioning is delayed until Pod scheduling
Source: https://kubernetes.io/docs/concepts/storage/storage-classes/
5 Pod using the PVC¶
6 What happens when the Pod is created¶
Step-by-step (this is the important part):
- Scheduler picks a node
- Kubernetes calls TopoLVM on that node
-
TopoLVM:
-
creates an LVM Logical Volume
- formats it (ext4)
- CSI creates a PV
- PVC is Bound
- Volume is mounted into
/data
7 Auto-created PersistentVolume (for understanding)¶
You normally never write this, but this is what appears:
Mapping to LVM¶
| Kubernetes | Linux |
|---|---|
| PV | Logical Volume |
| StorageClass | VG policy |
| PVC | LV size request |
Source: https://topolvm.io/docs/concepts/
8 Verify on the node (optional but enlightening)¶
On the node where the Pod runs:
You will see something like:
This confirms:
- real LVM is used
- Kubernetes is just orchestrating it
9 Deletion behavior¶
| Action | Result |
|---|---|
| Delete Pod | LV remains |
| Delete PVC | LV is deleted |
| Delete PV | LV already gone |
| Node failure | Data inaccessible |
Reclaim policy = Delete
Source: https://kubernetes.io/docs/concepts/storage/persistent-volumes/
10 Constraints (must be clear)¶
- ❌ No
ReadWriteMany - ❌ No automatic HA
- ❌ Pod is node-affined
- ✅ Very fast local storage
- ✅ Simple, transparent design
11 Full interaction chain (LVM)¶
Bottom line¶
- TopoLVM = local block storage via CSI
- Kubernetes does not manage data
- LVM remains pure Linux LVM
- CSI is just the control plane glue