Skip to content

Commit

Permalink
Merge pull request #94 from scality/flat_config_storage
Browse files Browse the repository at this point in the history
Flatten persistent storage configuration
  • Loading branch information
ballot-scality authored Jul 21, 2018
2 parents cacb028 + c27460f commit b6e49bc
Show file tree
Hide file tree
Showing 26 changed files with 532 additions and 359 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Breaking changes
be lost. Please see the pull-request description for manual steps required after
upgrading a MetalK8s 0.1 cluster to MetalK8s 0.2 (:ghissue:`147`)

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


Release 0.1.2 (in development)
==============================
Expand Down
32 changes: 32 additions & 0 deletions docs/architecture/storage.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
Storage Architecture
====================

MetalK8s current strage architecture rely on local storage, configured with LVM
for its purpose.

A default setup, satisfying the storage needs of MetalK8s is automatically
setup by default and can be easily extended through the various configuration
items exposed by the tool.

Glossary
########

* LVM PV: The LVM Physical Volume. This is the disk or the partition provided
to LVM to create the LVM Volume Group
* LVM VG : The LVM Volume Group. This is the logical unit of LVM aggregating
the LVM Physical Volumes into one single logical entity
* LVM LV: A Logical Volume. This is where the filesystem will be created.
Several LVM LVs can be created on a single LVM VG
* PV : Kubernetes Persistent Volume. This is what will be consumed by a
Persistent Volume Claim for the Kubernetes storage needs
* PVC : Kubernetes Persisten Volume Claim


Goal
####

MetalK8s provides a functional Kubernetes cluster with some opinionated
deployment for the monitoring and logging aspect.
These deployments require storage, but we wanted to provide an easy way for
the end user to add it's own configuration

As the deployment of Kubernetes on premise is focused on dedicated hardware,
Logical Volume Manager (LVM) has been chosen.
63 changes: 60 additions & 3 deletions docs/usage/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,73 @@ subdirectory of our inventory, we declare how to setup storage (in the
default configuration) on hosts in the *kube-node* group, i.e. hosts on which
Pods will be scheduled:

.. code-block:: yaml
metalk8s_lvm_drives_vg_metalk8s: ['/dev/vdb']
In the above, we assume every *kube-node* host has a disk available as
:file:`/dev/vdb` which can be used to set up Kubernetes *PersistentVolumes*. For
more information about storage, see :doc:`../architecture/storage`.

.. _upgrade_from_MetalK8s_before_0.2.0:

Upgrading from MetalK8s < 0.2.0
-------------------------------

The storage configuration changed in a non-backward compatible way on
MetalK8s 0.2.0 release.
The old configuration will trigger an error when the playbook
:file:`playbooks/deploy.yml` is run.


An old configuration looking like this

.. code-block:: yaml
metal_k8s_lvm:
vgs:
kubevg:
drives: ['/dev/vdb']
In the above, we assume every *kube-node* host has a disk available as
:file:`/dev/vdb` which can be used to set up Kubernetes *PersistentVolumes*. For
more information about storage, see :doc:`../architecture/storage`.
would become

.. code-block:: yaml
metalk8s_lvm_default_vg: False
metalk8s_lvm_vgs: ['kubevg']
metalk8s_lvm_drives_kubevg: ['/dev/vdb']
metalk8s_lvm_lvs_kubevg:
lv01:
size: 52G
lv02:
size: 52G
lv03:
size: 52G
lv04:
size: 11G
lv05:
size: 11G
lv06:
size: 11G
lv07:
size: 5G
lv08:
size: 5G
A quick explanation of these new variables and why they are required

* metalk8s_lvm_default_vg: The value *False* will ensure that we disable all
automatic logic behind configuring the storage

* metalk8s_lvm_vgs: This is a list of the LVM VGs managed by MetalK8s

* metalk8s_lvm_drives_kubevg: This variable is a concatenation of the prefix
*metalk8s_lvm_drives_* and the name of the LVM VG. It is used to specify
the drives used for this LVM VG

* metalk8s_lvm_lvs_kubevg: This variable is a concatenation of the prefix
*metalk8s_lvm_lvs_* and the name of the LVM VG. It is used to specify
the LVM LVs created in this LVM VG.

Entering the MetalK8s Shell
---------------------------
Expand Down
5 changes: 2 additions & 3 deletions playbooks/storage-post.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
- hosts: kube-node
- hosts: kube-master
tags:
- lvm-storage
- kube-pv
roles:
- role: kube_lvm_storage
- role: kube_lvm_storageclass
3 changes: 2 additions & 1 deletion playbooks/storage-pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
tags:
- lvm-storage
roles:
- role: setup_lvm
- role: setup_lvm_vg
- role: setup_lvm_lv
51 changes: 0 additions & 51 deletions roles/kube_lvm_storage/defaults/main.yml

This file was deleted.

2 changes: 0 additions & 2 deletions roles/kube_lvm_storage/meta/main.yml

This file was deleted.

Loading

0 comments on commit b6e49bc

Please sign in to comment.