@ -1,58 +1,62 @@
# Local Storage Provisioner
Local Storage Provisioner
=========================
The local storage provisioner is NOT a dynamic storage provisioner as you would
The local storage provisioner is NOT a dynamic storage provisioner as you would
expect from a cloud provider. Instead, it simply creates PersistentVolumes for
expect from a cloud provider. Instead, it simply creates PersistentVolumes for
all manually created volumes located in the directory `local_volume_base_dir` .
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
The default path is /mnt/disks and the rest of this doc will use that path as
an example.
an example.
## Examples to create local storage volumes
Examples to create local storage volumes
----------------------------------------
### tmpfs method:
### tmpfs method:
```
for vol in vol1 vol2 vol3; do
mkdir /mnt/disks/$vol
mount -t tmpfs -o size=5G $vol /mnt/disks/$vol
done
```
``` bash
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
The tmpfs method is not recommended for production because the mount is not
persistent and data will be deleted on reboot.
persistent and data will be deleted on reboot.
### Mount physical disks
### Mount physical disks
```
mkdir /mnt/disks/ssd1
mount /dev/vdb1 /mnt/disks/ssd1
```
``` bash
mkdir /mnt/disks/ssd1
mount /dev/vdb1 /mnt/disks/ssd1
```
Physical disks are recommended for production environments because it offers
Physical disks are recommended for production environments because it offers
complete isolation in terms of I/O and capacity.
complete isolation in terms of I/O and capacity.
### File-backed sparsefile method
### 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
```
``` bash
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
If you have a development environment and only one disk, this is the best way
to limit the quota of persistent volumes.
to limit the quota of persistent volumes.
### Simple directories
### Simple directories
```
for vol in vol6 vol7 vol8; do
mkdir /mnt/disks/$vol
done
```
``` bash
for vol in vol6 vol7 vol8; do
mkdir /mnt/disks/$vol
done
```
This is also acceptable in a development environment, but there is no capacity
This is also acceptable in a development environment, but there is no capacity
management.
management.
## Usage notes
Usage notes
-----------
The volume provisioner cannot calculate volume sizes correctly, so you should
The volume provisioner cannot calculate volume sizes correctly, so you should
delete the daemonset pod on the relevant host after creating volumes. The pod
delete the daemonset pod on the relevant host after creating volumes. The pod
@ -62,6 +66,7 @@ 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
CoreOS/Container Linux). Pods with persistent volume claims will not be
able to start if the mounts become unavailable.
able to start if the mounts become unavailable.
## Further reading
Further reading
---------------
Refer to the upstream docs here: https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume
Refer to the upstream docs here: < https: / / github . com / kubernetes-incubator / external-storage / tree / master / local-volume >