Volumes

Volumes are references from pods to storage units.

Volume types

In the wild you'll find persistentVolumeClaim most commonly, as it allows decoupling pod specification from the type of storage used.

Keys from Secrets and ConfigMaps can be mounted into pods:

  • configMap can be used to mount keys of ConfigMaps.
  • secret can be used to mount keys of Secrets.

Existing volumes can be imported mounted into pods, though their lifecycles won't be managed by the cluster:

  • cephfs mounts existing CephFS volumes.
  • fc mounts fibre channel volumes.
  • glusterfs allow replicated, multi-writer access to a volume.
  • iscsi mounts existing iSCSI volumes.
  • nfs mounts an external Network File System share.

Useful for testing, or for configurations in which the pod needs to be able to manipulate host configuration:

  • emptyDir is useful for storing transient data, and its lifetime is tied to the pod.
  • hostPath is Node-specific. Note the type field, which allows sharing sockets.

Cloud-specific volume types may be available based on the environment in which the cluster is running:

flexVolume is a pre-CSI mechanism for extension.


Backlinks