You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.9 KiB

  1. # Local Storage Provisioner
  2. The local storage provisioner is NOT a dynamic storage provisioner as you would
  3. expect from a cloud provider. Instead, it simply creates PersistentVolumes for
  4. all manually created volumes located in the directory `local_volume_base_dir`.
  5. The default path is /mnt/disks and the rest of this doc will use that path as
  6. an example.
  7. ## Examples to create local storage volumes
  8. ### tmpfs method:
  9. ```
  10. for vol in vol1 vol2 vol3; do
  11. mkdir /mnt/disks/$vol
  12. mount -t tmpfs -o size=5G $vol /mnt/disks/$vol
  13. done
  14. ```
  15. The tmpfs method is not recommended for production because the mount is not
  16. persistent and data will be deleted on reboot.
  17. ### Mount physical disks
  18. ```
  19. mkdir /mnt/disks/ssd1
  20. mount /dev/vdb1 /mnt/disks/ssd1
  21. ```
  22. Physical disks are recommended for production environments because it offers
  23. complete isolation in terms of I/O and capacity.
  24. ### File-backed sparsefile method
  25. ```
  26. truncate /mnt/disks/disk5 --size 2G
  27. mkfs.ext4 /mnt/disks/disk5
  28. mkdir /mnt/disks/vol5
  29. mount /mnt/disks/disk5 /mnt/disks/vol5
  30. ```
  31. If you have a development environment and only one disk, this is the best way
  32. to limit the quota of persistent volumes.
  33. ### Simple directories
  34. ```
  35. for vol in vol6 vol7 vol8; do
  36. mkdir /mnt/disks/$vol
  37. done
  38. ```
  39. This is also acceptable in a development environment, but there is no capacity
  40. management.
  41. ## Usage notes
  42. The volume provisioner cannot calculate volume sizes correctly, so you should
  43. delete the daemonset pod on the relevant host after creating volumes. The pod
  44. will be recreated and read the size correctly.
  45. Make sure to make any mounts persist via /etc/fstab or with systemd mounts (for
  46. CoreOS/Container Linux). Pods with persistent volume claims will not be
  47. able to start if the mounts become unavailable.
  48. ## Further reading
  49. Refer to the upstream docs here: https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume