Some workloads need different volumes with different storage capacities to fit their components needs. These volumes are stored in LVM Logical Volumes.
Considering all storage volumes required for workloads running in the cluster, create a configuration as below:
metalk8s_lvm_drives_vg_metalk8s: ['/dev/vdb'] metalk8s_lvm_lvs_vg_metalk8s: lv01: size: 52G lv02: size: 52G lv03: size: 52G lv04: size: 11G lv05: size: 11G lv06: size: 11G lv07: size: 5G lv08: size: 5G
Volumes can be resized (one or several at once). Change the volume size value to a higher one and run:
ansible-playbook -b -i <inventory>/hosts -t storage playbooks/deploy.yml
The configuration can be applied to groups and hosts in two different ways.
Configuration files are merged for every created host or group.
To apply a configuration, create a YAML file in either (or both)
host_vars with the group name
associated, or create a folder in
host_vars with several YAML files.
The ansible-playbook above must be run.
Add extra LVs¶
It is possible to configure LVM drives and volumes for one node only.
Exemplified below, a default storage configuration
# metalk8s_lvm_vgs = ['vg_metalk8s'] metalk8s_lvm_drives_vg_metalk8s: ['/dev/vdb'] metalk8s_lvm_lvs_vg_metalk8s: lv01: size: 52G lv02: size: 52G lv03: size: 52G
host_vars, create a new file (
metalk8s_lvm_vgs = ['vg_metalk8s', 'mynewvg'] metalk8s_lvm_drives_mynewvg: ['/dev/vdc'] metalk8s_lvm_lvs_vg_metalk8s: lv01: size: 52G metalk8s_lvm_lvs_mynewvg: lv01: size: 1T
node_1, every machine has a single vg_metalk8s with six
logical volumes (three specified, three default).
node_1, there are two volume groups (vg_metalk8s and
mynewvg) with four logical volumes on vg_metalk8s (one
specified, three default) and one logical volume on mynewvg.
As the volume group name becomes a prefix, several LVs can have the same name.