Volumes
Kubernetes supports many different subtypes of volumes. Most can be used for either volumes or persistent volumes, but some are specific to either resource. We'll start with the simplest and review a few types.
Important note
You can see the full current list of volume types at https://kubernetes.io/docs/concepts/storage/volumes/#types-of-volumes.
Here is a short list of volume subtypes:
awsElasticBlockStore
cephfs
ConfigMap
emptyDir
hostPath
local
nfs
persistentVolumeClaim
rbd
Secret
As you can see, both ConfigMaps and Secrets are actually implemented as types of volume. Additionally, the list includes cloud provider volume types such as awsElasticBlockStore
.
Unlike persistent volumes, which are created separately from any one Pod, creating a volume is most often done in the context of a Pod.
To create a simple volume, you can use the following Pod YAML:
pod-with-vol.yaml
apiVersion: v1 kind: Pod...