6.3. 백업 수행
참고
다음 샘플 hello-world 애플리케이션에는 연결된 영구 볼륨이 없습니다. DPA 구성이 작동합니다.
백업할 워크로드를 생성합니다.
$ oc create namespace hello-world $ oc new-app -n hello-world --image=docker.io/openshift/hello-openshift경로를 노출합니다.
$ oc expose service/hello-openshift -n hello-world애플리케이션이 작동하는지 확인합니다.
$ curl `oc get route/hello-openshift -n hello-world -o jsonpath='{.spec.host}'`출력 예
Hello OpenShift!워크로드를 백업합니다.
$ cat << EOF | oc create -f - apiVersion: velero.io/v1 kind: Backup metadata: name: hello-world namespace: openshift-adp spec: includedNamespaces: - hello-world storageLocation: ${CLUSTER_NAME}-dpa-1 ttl: 720h0m0s EOF백업이 완료될 때까지 기다립니다.
$ watch "oc -n openshift-adp get backup hello-world -o json | jq .status"출력 예
{ "completionTimestamp": "2022-09-07T22:20:44Z", "expiration": "2022-10-07T22:20:22Z", "formatVersion": "1.1.0", "phase": "Completed", "progress": { "itemsBackedUp": 58, "totalItems": 58 }, "startTimestamp": "2022-09-07T22:20:22Z", "version": 1 }데모 워크로드를 삭제합니다.
$ oc delete ns hello-world백업에서 복원:
$ cat << EOF | oc create -f - apiVersion: velero.io/v1 kind: Restore metadata: name: hello-world namespace: openshift-adp spec: backupName: hello-world EOF복원이 완료될 때까지 기다립니다.
$ watch "oc -n openshift-adp get restore hello-world -o json | jq .status"출력 예
{ "completionTimestamp": "2022-09-07T22:25:47Z", "phase": "Completed", "progress": { "itemsRestored": 38, "totalItems": 38 }, "startTimestamp": "2022-09-07T22:25:28Z", "warnings": 9 }워크로드가 복원되었는지 확인합니다.
$ oc -n hello-world get pods출력 예
NAME READY STATUS RESTARTS AGE hello-openshift-9f885f7c6-kdjpj 1/1 Running 0 90s$ curl `oc get route/hello-openshift -n hello-world -o jsonpath='{.spec.host}'`출력 예
Hello OpenShift!- 문제 해결 팁은 OADP 팀의 문제 해결 설명서를 참조하십시오.
- 추가 샘플 애플리케이션은 OADP 팀의 샘플 애플리케이션 디렉터리에서확인할 수 있습니다.