1- Using emptyDir for intra-pod communication Ref-->emptyDir
Usage:
- To share data between containers in the same pod using a shared volume. It is not Persistent , if pod removed from node, the contents are erased.
2- Using HostPath for intra-node communication Ref-->hostPath
Usage:
- If you want pods to get access to some host information or you want pods on the same node to communicate with each other (DaemonSet, Pod affinity, single node, etc ) It is not persistent in case of pod restarts and node restarts
3- Using local volumes for durable node storage Ref-->persistent-local-volume
Usage:
- Local volumes are similar to HostPath, but they persist across pod restarts and node restarts. In that sense, they are considered persistent volumes
- It is used to support StatefulSets where specific pods need to be scheduled on nodes that contain specific storage volumes
- Local volumes should have node affinity annotations.
- StorageClass needed in order to use local volumes.
4- Provisioning persistent volumes using DirectNFS Ref-->directNFS
Usage:
- It is good to move storage provisioners out of Kubernetes core into volume plugins ( NFS in this case )
5- Amazon EBS Ref-->Amazon-EBS
Limitations:
- Nodes should be AWS EC2 instances.
- Pods can only access EBS volumes in the same availability zone.
- EBS Volume can be mounted only on one node.
- Pods can not share the same EBS Volume unless they run on the same node.
Note that no need for a claim or storage class , we only mount the volume directly by ID
6- Amazon EFS Ref-->Amazon-EFS
- Managed NFS service and does not have the limitations of Amazon EBS but could be more expensive.
- External provisioner needed in order to allow you to mount EFS storage as PersistentVolumes in kubernetes.
- The pv/pvc config pretty similar to NFSdirect.
Note the EFS provisioner is not covered here!
7- gcePersistentDiskR Ref-->gcePersistentDisk
Limitations:
- It can only be used by GCE instances in the same project and zone.
Usage:
- it supports ReadWriteOnce and ReadOnlyMany. You can use it to share data as read-only between multiple pods in the same zone.
8- Azure Files Ref-->AzureFiles
- Azure Files uses the SMB/CIFS protocol
- In order to use Azure File you need to create a secret contains - azurestorageaccountname - azurestorageaccountkey