Persistent Volume & Claim
Persistent Volume
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-pv
spec:
capacity:
storage: 1Gi # 1GB Storage
accessModes:
- ReadWriteOnce # Only one node can mount it at a time
persistentVolumeReclaimPolicy: Retain # Keep data even if PVC is deleted
storageClassName: manual
hostPath:
path: "/mnt/data/postgresql" # Local storage for MinikubeApply and Validate
Persistent Volume Claim
Apply and Validate
Postgres Deployment
Apply and Validate
Postgres Service
Apply and Validate
Testing Data Persistence
References
Last updated