-
OADP operator, a credentials secret, and a DataProtectionApplication (DPA) CR are all created. Follow these steps for installation instructions.
- Make sure your DPA CR is similar to below in the install step.
-
Information on
backupLocations
andsnapshotLocations
specs can be found here.apiVersion: oadp.openshift.io/v1alpha1 kind: DataProtectionApplication metadata: name: dpa-sample spec: configuration: velero: defaultPlugins: - openshift - aws nodeAgent: enable: true uploaderType: restic backupLocations: - name: default velero: provider: aws default: true objectStorage: bucket: my-bucket prefix: my-prefix config: region: us-east-1 profile: "default" credential: name: cloud-credentials key: cloud snapshotLocations: - name: default velero: provider: aws config: region: us-west-2 profile: "default"
This is an example only, please use the appropriate storage class for your PVC.
oc create -f docs/examples/manifests/mysql/mysql-persistent-template.yaml -f pvc/[aws.yaml, azure.yaml, gcp.yaml, ibmcloud.yaml]
This example will create the following resources:
- Namespace
- Secret
- Service
- Route
- PersistentVolumeClaim
- Deployment
oc get all -n mysql-persistent
Should look similar to this:
NAME READY STATUS RESTARTS AGE
pod/mysql-6bb6964964-x4s8d 1/1 Running 0 54s
pod/todolist-1-59jqk 1/1 Running 0 51s
pod/todolist-1-deploy 0/1 Completed 0 54s
NAME DESIRED CURRENT READY AGE
replicationcontroller/todolist-1 1 1 1 54s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/mysql ClusterIP 172.30.73.117 <none> 3306/TCP 55s
service/todolist ClusterIP 172.30.92.118 <none> 8000/TCP 55s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/mysql 1/1 1 1 55s
NAME DESIRED CURRENT READY AGE
replicaset.apps/mysql-6bb6964964 1 1 1 55s
NAME REVISION DESIRED CURRENT TRIGGERED BY
deploymentconfig.apps.openshift.io/todolist 1 1 1 config
Visit the route location provided in the HOST/PORT
section following this command:
oc get routes -n mysql-persistent
Here you will see a table of data. Enter additional data and save. Once completed, it's time to begin a backup.
It is good practice to check the data in the database prior to taking the backup.
export TODOHOST=`oc get route -n mysql-persistent -o jsonpath='{range .items[*]}{.spec.host}'`
curl $TODOHOST/todo-incomplete
curl $TODOHOST/todo-completed
output:
curl $TODOHOST/todo-incomplete
[{"Id":1,"Description":"time to make the donuts","Completed":false},{"Id":3,"Description":"westest1","Completed":false},{"Id":4,"Description":"westest2","Completed":false}]
curl $TODOHOST/todo-completed
[{"Id":2,"Description":"prepopulate the db","Completed":true}]
oc create -f docs/examples/manifests/mysql/mysql-backup.yaml
oc get backup -n openshift-adp mysql-persistent -o jsonpath='{.status.phase}'
should result in Completed
Once we have ensured the backup is completed, we want to test the restore
process. First, delete the mysql-persistent
project:
oc delete namespace mysql-persistent
oc create -f docs/examples/manifests/mysql/mysql-restore.yaml
oc get restore -n openshift-adp mysql-persistent -o jsonpath='{.status.phase}'
Should result in Completed
oc get all -n mysql-persistent
Should look similar to this:
NAME READY STATUS RESTARTS AGE
pod/mysql-6bb6964964-x4s8d 1/1 Running 0 54s
pod/todolist-1-59jqk 1/1 Running 0 51s
pod/todolist-1-deploy 0/1 Completed 0 54s
NAME DESIRED CURRENT READY AGE
replicationcontroller/todolist-1 1 1 1 54s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/mysql ClusterIP 172.30.73.117 <none> 3306/TCP 55s
service/todolist ClusterIP 172.30.92.118 <none> 8000/TCP 55s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/mysql 1/1 1 1 55s
NAME DESIRED CURRENT READY AGE
replicaset.apps/mysql-6bb6964964 1 1 1 55s
NAME REVISION DESIRED CURRENT TRIGGERED BY
deploymentconfig.apps.openshift.io/todolist 1 1 1 config
oc get routes -n mysql-persistent
Check the data in the table previously entered is present.
output:
curl $TODOHOST/todo-incomplete
[{"Id":1,"Description":"time to make the donuts","Completed":false},{"Id":3,"Description":"westest1","Completed":false},{"Id":4,"Description":"westest2","Completed":false}]
curl $TODOHOST/todo-completed
[{"Id":2,"Description":"prepopulate the db","Completed":true}]