Restore a PVC from an NFS Folder and Attach it to a Pod
This Guide explains how to Restore PVC from NFS Folder and Attach to Pod.
Verify the NFS data folder
Create a persistentvolume (PV)
apiVersion: v1 kind: PersistentVolume metadata: name: pvc-477f63d2-9cf2-42ff-bf99-1e5b74c5f0f9 # Update with actual PV name annotations: pv.kubernetes.io/provisioned-by: nfs.csi.k8s.io finalizers: - kubernetes.io/pv-protection spec: capacity: storage: 8Gi accessModes: - ReadWriteOnce # Use ReadWriteMany if needed persistentVolumeReclaimPolicy: Retain storageClassName: nfs-csi volumeMode: Filesystem claimRef: name: data-pbms-postgresql-0 # Update with actual PVC name namespace: dev # Update with actual namespace csi: driver: nfs.csi.k8s.io volumeHandle: 172.29.68.134#srv/nfs/dev#dev-data-pbms-postgresql-0-pvc-477f63d2-9cf2-42ff-bf99-1e5b74c5f0f9 # Update with host, path, and full PVC name volumeAttributes: server: 172.29.68.134 # Update with NFS server IP address share: /srv/nfs/dev # Update with NFS path subDir: dev-data-pbms-postgresql-0-pvc-477f63d2-9cf2-42ff-bf99-1e5b74c5f0f9 # Update with full PVC name mountPermissions: '0777' status: phasekubectl apply -f <pv.yaml> -n <namespace>
Deploy the services
PreviousTransitioning PostgreSQL From Docker on K8s to Standalone PostgreSQLNextView System Logs on the OpenSearch Dashboard
Last updated
