Skip to content

Commit b6e49bc

Browse files
Merge pull request #94 from scality/flat_config_storage
Flatten persistent storage configuration
2 parents cacb028 + c27460f commit b6e49bc

File tree

26 files changed

+532
-359
lines changed

26 files changed

+532
-359
lines changed

ChangeLog.rst

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Breaking changes
99
be lost. Please see the pull-request description for manual steps required after
1010
upgrading a MetalK8s 0.1 cluster to MetalK8s 0.2 (:ghissue:`147`)
1111

12+
:ghpull:`94` - flatten the storage configuration and allow more user defined
13+
storage related actions. Please see :ref:`upgrade_from_MetalK8s_before_0.2.0`
14+
(:ghissue:`153`)
15+
1216

1317
Release 0.1.2 (in development)
1418
==============================

docs/architecture/storage.rst

+32
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
11
Storage Architecture
22
====================
3+
4+
MetalK8s current strage architecture rely on local storage, configured with LVM
5+
for its purpose.
6+
7+
A default setup, satisfying the storage needs of MetalK8s is automatically
8+
setup by default and can be easily extended through the various configuration
9+
items exposed by the tool.
10+
11+
Glossary
12+
########
13+
14+
* LVM PV: The LVM Physical Volume. This is the disk or the partition provided
15+
to LVM to create the LVM Volume Group
16+
* LVM VG : The LVM Volume Group. This is the logical unit of LVM aggregating
17+
the LVM Physical Volumes into one single logical entity
18+
* LVM LV: A Logical Volume. This is where the filesystem will be created.
19+
Several LVM LVs can be created on a single LVM VG
20+
* PV : Kubernetes Persistent Volume. This is what will be consumed by a
21+
Persistent Volume Claim for the Kubernetes storage needs
22+
* PVC : Kubernetes Persisten Volume Claim
23+
24+
25+
Goal
26+
####
27+
28+
MetalK8s provides a functional Kubernetes cluster with some opinionated
29+
deployment for the monitoring and logging aspect.
30+
These deployments require storage, but we wanted to provide an easy way for
31+
the end user to add it's own configuration
32+
33+
As the deployment of Kubernetes on premise is focused on dedicated hardware,
34+
Logical Volume Manager (LVM) has been chosen.

docs/usage/quickstart.rst

+60-3
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,73 @@ subdirectory of our inventory, we declare how to setup storage (in the
6464
default configuration) on hosts in the *kube-node* group, i.e. hosts on which
6565
Pods will be scheduled:
6666

67+
.. code-block:: yaml
68+
69+
metalk8s_lvm_drives_vg_metalk8s: ['/dev/vdb']
70+
71+
In the above, we assume every *kube-node* host has a disk available as
72+
:file:`/dev/vdb` which can be used to set up Kubernetes *PersistentVolumes*. For
73+
more information about storage, see :doc:`../architecture/storage`.
74+
75+
.. _upgrade_from_MetalK8s_before_0.2.0:
76+
77+
Upgrading from MetalK8s < 0.2.0
78+
-------------------------------
79+
80+
The storage configuration changed in a non-backward compatible way on
81+
MetalK8s 0.2.0 release.
82+
The old configuration will trigger an error when the playbook
83+
:file:`playbooks/deploy.yml` is run.
84+
85+
86+
An old configuration looking like this
87+
6788
.. code-block:: yaml
6889
6990
metal_k8s_lvm:
7091
vgs:
7192
kubevg:
7293
drives: ['/dev/vdb']
7394
74-
In the above, we assume every *kube-node* host has a disk available as
75-
:file:`/dev/vdb` which can be used to set up Kubernetes *PersistentVolumes*. For
76-
more information about storage, see :doc:`../architecture/storage`.
95+
would become
96+
97+
.. code-block:: yaml
98+
99+
metalk8s_lvm_default_vg: False
100+
metalk8s_lvm_vgs: ['kubevg']
101+
metalk8s_lvm_drives_kubevg: ['/dev/vdb']
102+
metalk8s_lvm_lvs_kubevg:
103+
lv01:
104+
size: 52G
105+
lv02:
106+
size: 52G
107+
lv03:
108+
size: 52G
109+
lv04:
110+
size: 11G
111+
lv05:
112+
size: 11G
113+
lv06:
114+
size: 11G
115+
lv07:
116+
size: 5G
117+
lv08:
118+
size: 5G
119+
120+
A quick explanation of these new variables and why they are required
121+
122+
* metalk8s_lvm_default_vg: The value *False* will ensure that we disable all
123+
automatic logic behind configuring the storage
124+
125+
* metalk8s_lvm_vgs: This is a list of the LVM VGs managed by MetalK8s
126+
127+
* metalk8s_lvm_drives_kubevg: This variable is a concatenation of the prefix
128+
*metalk8s_lvm_drives_* and the name of the LVM VG. It is used to specify
129+
the drives used for this LVM VG
130+
131+
* metalk8s_lvm_lvs_kubevg: This variable is a concatenation of the prefix
132+
*metalk8s_lvm_lvs_* and the name of the LVM VG. It is used to specify
133+
the LVM LVs created in this LVM VG.
77134

78135
Entering the MetalK8s Shell
79136
---------------------------

playbooks/storage-post.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
- hosts: kube-node
1+
- hosts: kube-master
22
tags:
3-
- lvm-storage
43
- kube-pv
54
roles:
6-
- role: kube_lvm_storage
5+
- role: kube_lvm_storageclass

playbooks/storage-pre.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
tags:
33
- lvm-storage
44
roles:
5-
- role: setup_lvm
5+
- role: setup_lvm_vg
6+
- role: setup_lvm_lv

roles/kube_lvm_storage/defaults/main.yml

-51
This file was deleted.

roles/kube_lvm_storage/meta/main.yml

-2
This file was deleted.

0 commit comments

Comments
 (0)