More dynamic local-storage-provisioner approach (#3472)

* Makes local volume provisioner more dynamic

* Correct variable name in local storage provisioner defaults

* Updates external-provisioner readme

* Updates variable naming to be more clear, more documentation, fixes sample inventory

* Variable refactor, untangled some jinja2 loops

* Corrects variable name

* No variable substitution in dict keys, replaced with anchor

* Fixes default storage_classes dict, inline docs

* Fixes spelling in inline docs

* Addresses comments in review

* Updates all the defaults

* Fix failing CI task

* Fixes external provisioner daemonset
This commit is contained in:
Wilmar den Ouden
2019-01-08 21:36:44 +01:00
committed by Kubernetes Prow Robot
parent 5c52a830d2
commit 4fb8adb9e4
10 changed files with 107 additions and 45 deletions

View File

@@ -1,11 +1,51 @@
Local Storage Provisioner
=========================
The local storage provisioner is NOT a dynamic storage provisioner as you would
The [local storage provisioner](https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume)
is NOT a dynamic storage provisioner as you would
expect from a cloud provider. Instead, it simply creates PersistentVolumes for
all manually created volumes located in the directories specified in the `local_volume_provisioner_storage_classes.host_dir` entries.
The default path is /mnt/disks and the rest of this doc will use that path as
an example.
all mounts under the host_dir of the specified storage class.
These storage classes are specified in the `local_volume_provisioner_storage_classes` list.
An example this list:
```yaml
local_volume_provisioner_storage_classes:
- local-storage:
host_dir: /mnt/disks
mount_dir: /mnt/disks
- fast-disks:
host_dir: /mnt/fast-disks
mount_dir: /mnt/fast-disks
block_cleaner_command:
- "/scripts/shred.sh"
- "2"
volume_mode: Filesystem
fs_type: ext4
```
For each dictionary in `local_volume_provisioner_storage_classes` a storageClass with the
same name is created. The keys of this dictionary are converted to camelCase and added
as attributes to the storageClass.
The result of the above example is:
```yaml
data:
storageClassMap: |
local-storage:
hostDir: /mnt/disks
mountDir: /mnt/disks
fast-disks:
hostDir: /mnt/fast-disks
mountDir: /mnt/fast-disks
blockCleanerCommand:
- "/scripts/shred.sh"
- "2"
volumeMode: Filesystem
fsType: ext4
```
The default StorageClass is local-storage on /mnt/disks,
the rest of this doc will use that path as an example.
Examples to create local storage volumes
----------------------------------------