2 min read | by Jordi Prats
A PersistentVolume is the abstract representation of storage as a resource within a Kubernetes cluster. The attributes describe the storage resource, it's underlying resource can either be a disk provisioned by the cloud you are using or something as simple as manually provisioned NFS disk
On PersistentVolumes we can configure several reclaim policies to define how it's data removal is handled once the PersistentVolume object is deleted.
apiVersion: v1
kind: PersistentVolume
metadata:
name: demo-pv
spec:
accessModes:
- ReadWriteOnce
awsElasticBlockStore:
fsType: ext4
capacity:
storage: 10Gi
persistentVolumeReclaimPolicy: Retain
storageClassName: gp2
volumeMode: Filesystem
The persistentVolumeReclaimPolicy determines how the storage resources can be reused when it is no longer needed:
Posted on 12/01/2022