Skip to main content

Restore Persistent Volume on Kubernetes

The restore volume feature lets you restore data in a Persistent Volume (PV) from an existing snapshot. The process is fully native to Kubernetes: configure a PVC based on an existing snapshot, then point your application's PVC or volumeMount configuration at the newly created PVC. See the Kubernetes documentation on volume PVC data sources for background.

Restore a volume from a snapshot​

Configure and apply a PVC YAML file that references the snapshot as its data source:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: <new-pvc-name>
namespace: <namespace>
spec:
dataSource:
name: new-snapshot-test
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi

After applying it, configure this PVC in your application as needed.