What are PersistentVolume (PV), PersistentVolumeClaim (PVC) and StorageClass?
BeginnerConceptConfiguration & Storage
Answer
A PV is a piece of storage in the cluster; a PVC is a user's request for storage (size, access mode, class); a StorageClass describes a "type" of storage and its provisioner for dynamic provisioning. A PVC binds to a PV, and Pods reference the PVC.
apiVersion: v1
kind: PersistentVolumeClaim
metadata: { name: data }
spec:
accessModes: [ReadWriteOnce]
storageClassName: gp3
resources: { requests: { storage: 20Gi } }
More on Configuration & Storage
What is a ConfigMap and how can a Pod consume it?BeginnerWhat is a Secret and is it secure by default?BeginnerWhat are the common Secret types?BeginnerWhat is a Volume and how does it differ from a container filesystem?BeginnerWhat is `emptyDir` and when is it used?BeginnerWhat are the PV access modes?Beginner