You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You back up applications by creating a xref:../../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc#oadp-creating-backup-cr_backing-up-applications[`Backup` custom resource (CR)].
9
+
10
+
The `Backup` CR creates backup files for Kubernetes resources and internal images, on S3 object storage, and snapshots for persistent volumes (PVs), if the cloud provider uses a native snapshot API or the xref:../../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc#oadp-backing-up-pvs-csi_backing-up-applications[Container Snapshot Interface (CSI)] to create snapshots, such as OpenShift Container Storage 4. For more information, see xref:../../../storage/container_storage_interface/persistent-storage-csi-snapshots.adoc#persistent-storage-csi-snapshots[CSI volume snapshots].
11
+
12
+
:FeatureName: The CloudStorage API for S3 storage
13
+
include::modules/technology-preview.adoc[]
14
+
15
+
You can create xref:../../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc#oadp-creating-backup-hooks_backing-up-applications[backup hooks] to run commands before or after the backup operation.
16
+
17
+
You can schedule backups by creating a xref:../../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc#oadp-scheduling-backups_backing-up-applications[`Schedule` CR] instead of a `Backup` CR.
18
+
19
+
If your cloud provider does not support snapshots or if your applications run on NFS data volumes, you can back up applications by using xref:../../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc#oadp-backing-up-applications-restic_backing-up-applications[Restic].
You restore application backups by creating a xref:../../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/restoring-applications.adoc#oadp-creating-restore-cr_restoring-applications[`Restore` custom resources (CRs)].
9
+
10
+
You can create xref:../../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/restoring-applications.adoc#oadp-creating-restore-hooks_restoring-applications[restore hooks] to run commands in init containers, before the application container starts, or in the application container itself.
= Backing up persistent volumes with Container Snapshot Interface snapshots
7
+
8
+
You back up persistent volumes with Container Snapshot Interface (CSI) snapshots by editing the `DataProtectionApplication` custom resource (CR) and creating a `VolumeSnapshotClass` CR before you create a `Backup` CR.
9
+
10
+
.Prerequisites
11
+
12
+
* The cloud provider must support CSI snapshots.
13
+
* You must install the OpenShift API for Data Protection (OADP) Operator.
14
+
15
+
.Procedure
16
+
17
+
. Edit the `DataProtectionApplication` CR, as in the following example:
18
+
+
19
+
[source,yaml]
20
+
----
21
+
apiVersion: oadp.openshift.io/v1alpha1
22
+
kind: DataProtectionApplication
23
+
...
24
+
spec:
25
+
configuration:
26
+
velero:
27
+
defaultPlugins:
28
+
- openshift
29
+
- csi <1>
30
+
featureFlags:
31
+
- EnableCSI <2>
32
+
----
33
+
<1> Add the `csi` default plug-in.
34
+
<2> Add the `EnableCSI` feature flag.
35
+
36
+
. Create a `VolumeSnapshotClass` CR for your cloud provider, as in the following example:
37
+
+
38
+
[source,yaml]
39
+
----
40
+
apiVersion: snapshot.storage.k8s.io/v1
41
+
kind: VolumeSnapshotClass
42
+
metadata:
43
+
name: <volume_snapshot_class>
44
+
labels:
45
+
velero.io/csi-volumesnapshot-class: "true"
46
+
driver: <csi_driver> <1>
47
+
deletionPolicy: Retain
48
+
----
49
+
<1> Specify the CSI driver, for example, `ebs.csi.aws.com`.
You back up Kubernetes images, internal images, and persistent volumes (PVs) by creating a `Backup` custom resource (CR).
9
+
10
+
.Prerequisites
11
+
12
+
* You must install the OpenShift API for Data Protection (OADP) Operator.
13
+
* The `DataProtectionApplication` CR must be in a `Ready` state.
14
+
* Backup prerequisites:
15
+
** You must have object storage configured for Velero.
16
+
** You must have a backup location configured in the `DataProtectionApplication` CR.
17
+
* Snapshot prerequisites:
18
+
** You must have a cloud provider that uses a native snapshot API or the Container Snapshot Interface (CSI) to create snapshots, such as OpenShift Container Storage 4.
19
+
** You must have a volume location configured in the `DataProtectionApplication` CR.
20
+
21
+
.Procedure
22
+
23
+
. Retrieve the `backupStorageLocations` CRs:
24
+
+
25
+
[source,terminal]
26
+
----
27
+
$ oc get backupStorageLocations
28
+
----
29
+
+
30
+
.Example output
31
+
+
32
+
[source,terminal]
33
+
----
34
+
NAME PHASE LAST VALIDATED AGE DEFAULT
35
+
velero-sample-1 Available 11s 31m
36
+
----
37
+
38
+
. Create a `Backup` CR, as in the following example:
39
+
+
40
+
[source,yaml]
41
+
----
42
+
apiVersion: velero.io/v1
43
+
kind: Backup
44
+
metadata:
45
+
name: <backup>
46
+
labels:
47
+
velero.io/storage-location: default
48
+
namespace: openshift-adp
49
+
spec:
50
+
hooks: {}
51
+
includedNamespaces:
52
+
- <namespace> <1>
53
+
includeClusterResources: true
54
+
storageLocation: <velero-sample-1> <2>
55
+
ttl: 720h0m0s
56
+
----
57
+
<1> Specify an array of namespaces to back up.
58
+
<2> Specify the name of the `backupStorageLocations` CR.
59
+
60
+
. Verify that the status of the `Backup` CR is `Completed`:
61
+
+
62
+
[source,terminal]
63
+
----
64
+
$ oc get backup -n openshift-adp <backup> -o jsonpath='{.status.phase}'
0 commit comments