K8s PV (Persistent Volumes)

 
💡
Short and Simple
Persistent Volume (PV) - Available storage let's say you have 100Gi
Persistent Volume Claim (PVC) - You request from Persistent Volume, let's say you request 10Gi you'll get it but if you request 110Gi you won't get it.
 
Managing storage is a distinct problem from managing compute instances.
The PersistentVolume subsystem provides an API for users and administrators that abstracts details of how storage is provided from how it is consumed.
To do this, we introduce two new API resources: PersistentVolume and PersistentVolumeClaim.

PersistentVolume

  • a piece of storage in the cluster
  • a resource in the cluster just like a node is a cluster resource
  • volume plugins like Volumes
    • lifecycle independent of any individual Pod that uses the PV
 

PersistentVolumeClaim

  • a request for storage by a user
  • similar to a Pod
  • Pods consume node resources and PVCs consume PV resources
    • Claims can request specific size and access modes
    • access modes : ReadWriteOnce, ReadOnlyMany or ReadWriteMany