TopoLVM
TopoLVM is a CSI plugin using LVM for Kubernetes. It can be considered as a specific implementation of local persistent volumes using CSI and LVM.
Their repo and helm chart are available at: https://github.com/topolvm/topolvm
Nothing in this guide is specific to TrueCharts. There are some Talos-specific steps, but they can be completed even more simply on other OSs.
Requirements
TopoLVM requires it’s own LVM Volume Group to provision storage from. In this guide we’ll assume you’re accomplishing this by providing a separate drive (or virtual disk) specifically for TopoLVM to keep it more simple.
LVM Prep
In this guide we are preparing LVM to use in a clustertool environment. Also the configuration is done in a way it can be used by e.g. volsync for backup/restore functionalities. Complete preparation is based upon:
- https://github.com/topolvm/topolvm/blob/main/docs/getting-started.md
- https://github.com/topolvm/topolvm/blob/main/docs/snapshot-and-restore.md
Most important highlights of above are the:
- Use of cert-manager
- Correctly labeled namespaces
- Installation of CRDs and the controller for volume snapshots
All are implemented and setup in Clustertool for your convenience.
To prepare the disk for a thin pool, use TrueCharts’ LVM_disk_watcher chart and container, which can do these steps to a disk you configure. Chart information at: https://truecharts.org/charts/system/lvm-disk-watcher/
Find the name of the disk you want to use for TopoLVM. With Talos OS, use talosctl disks
to list the names of the available disks. You may need to install another disk to your VM or your bare-metal server.
Install Lvm_Disk
Create the namespace with these labels:
Example of deployment:
Install TopoLVM
Now that you’ve completed your prep on the node to create volumes for TopoLVM to use, we can install TopoLVM. The reference Values and their explanations could be find here: https://github.com/topolvm/topolvm/blob/main/charts/topolvm/values.yaml
Helm Values
The key things to update are adding a device-class that will use your thin pool, and adding a storage class that will use that device-class. Read their helm chart for more options. The following example can be used and adjust where necesarry.
Snapshots
TBD
Kernel Modules
Add these two kernel modules. Use modprobe for typical linux installs or add them to your talconfig.yaml if using TalHelper or ClusterTool as shown below:
Manually add disks
These commands set up a Volume Group and Thin Pool for TopoLVM to use. The names of these will need to be put into your TopoLVM Helm Values. The name of the disk may vary depending on your setup.
Create a Physical Volume
Create a Volume Group
Create a Thin Pool
Create Privilaged Namespace
Create the namespace with these labels:
Other references
Other resource for guidance: https://github.com/topolvm/topolvm/blob/main/docs/proposals/thin-volumes.md