Home > Storage > PowerFlex > White Papers > Oracle in Docker Containers Managed by Kubernetes > Step 6: Create snapshots and restore persistent volume
After creating the PVC in step 5, use these yaml files to create a snapshot and to perform a volume restore after installation of a new pod. The objective behind this step is to create a “point in time database” with the help of PowerFlex snapshot and CSI Driver for Dell EMC PowerFlex. The example yaml file that creates a persistent volume for the backed up snapshot is as follows:
#
apiVersion: snapshot.storage.k8s.io/v1alpha1
kind: VolumeSnapshot
metadata:
name: pvc-1-snap
namespace: default
spec:
snapshotClassName: vxflexos-snapclass
source:
name: pvc-1
kind: PersistentVolumeClaim
The example yaml file for creating a persistent volume claim for restoring the backed up snapshot is as follows:
#
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-1-restore
namespace: default
spec:
storageClassName: vxflexos
dataSource:
name: pvc-1-snap
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi