c12s-kubespray/roles/kubernetes-apps/external_provisioner/local_volume_provisioner
Kuldip Madnani 36898a2c39 Adding pod priority for all the components. (#3361)
* Changes to assign pod priority to kube components.

* Removed the boolean flag pod_priority_assignment

* Created new priorityclass k8s-cluster-critical

* Created new priorityclass k8s-cluster-critical

* Fixed the trailing spaces

* Fixed the trailing spaces

* Added kube version check while creating Priority Class k8s-cluster-critical

* Moved k8s-cluster-critical.yml

* Moved k8s-cluster-critical.yml to kube_config_dir
2018-09-25 07:50:22 -07:00
..
defaults local-volume-provisioner: container download related things should defined in the download role 2018-04-02 13:50:11 +08:00
tasks Fix wrong syntax for jinja sub list extraction and addition of missing role template 2018-08-29 12:58:10 +02:00
templates Adding pod priority for all the components. (#3361) 2018-09-25 07:50:22 -07:00
README.md local-volume-provisioner: use mountPropagation HostToContainer and version bump (#3081) 2018-08-10 17:14:34 +03:00

Local Storage Provisioner

The local storage provisioner 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 directory local_volume_provisioner_base_dir. The default path is /mnt/disks and the rest of this doc will use that path as an example.

Examples to create local storage volumes

tmpfs method:

for vol in vol1 vol2 vol3; do
mkdir /mnt/disks/$vol
mount -t tmpfs -o size=5G $vol /mnt/disks/$vol
done

The tmpfs method is not recommended for production because the mount is not persistent and data will be deleted on reboot.

Mount physical disks

mkdir /mnt/disks/ssd1
mount /dev/vdb1 /mnt/disks/ssd1

Physical disks are recommended for production environments because it offers complete isolation in terms of I/O and capacity.

File-backed sparsefile method

truncate /mnt/disks/disk5 --size 2G
mkfs.ext4 /mnt/disks/disk5
mkdir /mnt/disks/vol5
mount /mnt/disks/disk5 /mnt/disks/vol5

If you have a development environment and only one disk, this is the best way to limit the quota of persistent volumes.

Simple directories

In a development environment using mount --bind works also, but there is no capacity management.

Block volumeMode PVs

Create a symbolic link under discovery directory to the block device on the node. To use raw block devices in pods BlockVolume feature gate must be enabled.

Usage notes

Beta PV.NodeAffinity field is used by default. If running against an older K8s version, the useAlphaAPI flag must be set in the configMap.

The volume provisioner cannot calculate volume sizes correctly, so you should delete the daemonset pod on the relevant host after creating volumes. The pod will be recreated and read the size correctly.

Make sure to make any mounts persist via /etc/fstab or with systemd mounts (for CoreOS/Container Linux). Pods with persistent volume claims will not be able to start if the mounts become unavailable.

Further reading

Refer to the upstream docs here: https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume