mkdir -p /root/data
chmod -R 777 /root/data/
kind: PersistentVolume
apiVersion: v1
metadata:
name: data-ghost-mariadb-pv-0
labels:
type: hostpath
spec:
storageClassName: "hostpath"
volumeMode: Filesystem
persistentVolumeReclaimPolicy: Retain
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /root/data/data-ghost-mariadb-pv-0
claimRef:
kind: PersistentVolumeClaim
namespace: ghost
name: data-ghost-mariadb-0
kind: PersistentVolume
apiVersion: v1
metadata:
name: data-ghost-pv-0
labels:
type: hostpath
spec:
storageClassName: "hostpath"
volumeMode: Filesystem
persistentVolumeReclaimPolicy: Recycle #
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /root/data/data-ghost-pv-0
claimRef:
kind: PersistentVolumeClaim
namespace: ghost
name: ghost
chown -R 1001:1001 /root/data/data-ghost-pv-0
persistentVolumeReclaimPolicy: Retain | Delete | Recycle (deprecated)
- Retain: When PVC is deleted, the PV still exists 🡪 Manual reclamation of the resource (Adminstrator: delete PV and associated data, then )
- Delete: Remove both PV /aws the associated storage
- Recyle: Remove all the content (
rm -rf /the-volume/*
) then make it avalable again