Containers have inbuilt problem with read write layers which is solved by volumes
When we deal with k8s we are not dealing with single node
K8s gives options to have the volumes from external locations as well.
K8s has CSI which helps in dealing with External storages
Popular csi providers for k8s give me options in on-prem as well as popular cloud providers in a tabular form
K8s has two types of volumes
Volume
Persistent Volume (PV)
K8s Pod will create a claim (request) which is called as Persitent Volume Claim which interacts with CSI to deal with storage and creates a PV (Peristent Volume)
Steps involved:
Create a PVC with storage requests
Use this PVC in pod spec and mount the PV in the container