mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 21:46:22 +01:00
177 lines
4.6 KiB
Plaintext
177 lines
4.6 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * backup_and_restore/application_backup_and_restore/oadp-use-cases/oadp-usecase-legacy-aws-plugin.adoc
|
|
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="oadp-using-legacy-aws-plugin_{context}"]
|
|
= Using the legacy-aws Velero plugin in the DataProtectionApplication CR
|
|
|
|
In the following use case, you configure the `DataProtectionApplication` CR with the `legacy-aws` Velero plugin and then back up an application.
|
|
|
|
[NOTE]
|
|
====
|
|
Depending on the backup storage location you choose, you can use either the `legacy-aws` or the `aws` plugin in your `DataProtectionApplication` CR. If you use both of the plugins in the `DataProtectionApplication` CR, the following error occurs: `aws and legacy-aws can not be both specified in DPA spec.configuration.velero.defaultPlugins`.
|
|
====
|
|
|
|
.Prerequisites
|
|
|
|
* You have installed the {oadp-short} Operator.
|
|
* You have configured an {aws-short} S3-compatible object storage as a backup location.
|
|
* You have an application with a database running in a separate namespace.
|
|
|
|
.Procedure
|
|
|
|
. Configure the `DataProtectionApplication` CR to use the `legacy-aws` Velero plugin as shown in the following example:
|
|
+
|
|
.Example `DataProtectionApplication` CR
|
|
[source,yaml]
|
|
----
|
|
apiVersion: oadp.openshift.io/v1alpha1
|
|
kind: DataProtectionApplication
|
|
metadata:
|
|
name: oadp-backup
|
|
namespace: openshift-adp
|
|
spec:
|
|
configuration:
|
|
nodeAgent:
|
|
enable: true
|
|
uploaderType: kopia
|
|
velero:
|
|
defaultPlugins:
|
|
- legacy-aws # <1>
|
|
- openshift
|
|
- csi
|
|
defaultSnapshotMoveData: true
|
|
backupLocations:
|
|
- velero:
|
|
config:
|
|
profile: "default"
|
|
region: noobaa
|
|
s3Url: https://s3.openshift-storage.svc
|
|
s3ForcePathStyle: "true"
|
|
insecureSkipTLSVerify: "true"
|
|
provider: aws
|
|
default: true
|
|
credential:
|
|
key: cloud
|
|
name: cloud-credentials
|
|
objectStorage:
|
|
bucket: <bucket_name> # <2>
|
|
prefix: oadp
|
|
----
|
|
<1> Use the `legacy-aws` plugin.
|
|
<2> Specify the bucket name.
|
|
|
|
. Create the `DataProtectionApplication` CR by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc apply -f <dpa_filename>
|
|
----
|
|
|
|
. Verify that the `DataProtectionApplication` CR is created successfully by running the following command. In the example output, you can see the `status` object has the `type` field set to `Reconciled` and the `status` field set to `"True"`. That status indicates that the `DataProtectionApplication` CR is successfully created.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get dpa -o yaml
|
|
----
|
|
+
|
|
.Example output
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: v1
|
|
items:
|
|
- apiVersion: oadp.openshift.io/v1alpha1
|
|
kind: DataProtectionApplication
|
|
metadata:
|
|
namespace: openshift-adp
|
|
#...#
|
|
spec:
|
|
backupLocations:
|
|
- velero:
|
|
config:
|
|
#...#
|
|
status:
|
|
conditions:
|
|
- lastTransitionTime: "20....9:54:02Z"
|
|
message: Reconcile complete
|
|
reason: Complete
|
|
status: "True"
|
|
type: Reconciled
|
|
kind: List
|
|
metadata:
|
|
resourceVersion: ""
|
|
----
|
|
|
|
. Verify that the backup storage location (BSL) is available by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get backupstoragelocations.velero.io -n openshift-adp
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
NAME PHASE LAST VALIDATED AGE DEFAULT
|
|
dpa-sample-1 Available 3s 15s true
|
|
----
|
|
|
|
. Configure a `Backup` CR as shown in the following example:
|
|
+
|
|
.Example backup CR
|
|
[source,yaml]
|
|
----
|
|
apiVersion: velero.io/v1
|
|
kind: Backup
|
|
metadata:
|
|
name: test-backup
|
|
namespace: openshift-adp
|
|
spec:
|
|
includedNamespaces:
|
|
- <application_namespace> # <1>
|
|
----
|
|
<1> Specify the namespace for the application to back up.
|
|
|
|
. Create the `Backup` CR by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc apply -f <backup_cr_filename>
|
|
----
|
|
|
|
.Verification
|
|
|
|
* Verify that the backup object is in the `Completed` phase by running the following command. For more details, see the example output.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc describe backups.velero.io test-backup -n openshift-adp
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
Name: test-backup
|
|
Namespace: openshift-adp
|
|
# ....#
|
|
Status:
|
|
Backup Item Operations Attempted: 1
|
|
Backup Item Operations Completed: 1
|
|
Completion Timestamp: 2024-09-25T10:17:01Z
|
|
Expiration: 2024-10-25T10:16:31Z
|
|
Format Version: 1.1.0
|
|
Hook Status:
|
|
Phase: Completed
|
|
Progress:
|
|
Items Backed Up: 34
|
|
Total Items: 34
|
|
Start Timestamp: 2024-09-25T10:16:31Z
|
|
Version: 1
|
|
Events: <none>
|
|
----
|
|
|
|
|