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.

74 lines
2.2 KiB

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