Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #71 from stakater/update-DR-doc
Browse files Browse the repository at this point in the history
add warning for resoure filter usage
  • Loading branch information
rasheedamir authored Jan 28, 2021
2 parents 3961c00 + d0abf99 commit d1bfef0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions content/sre/backup-restore/backup-restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ metadata:
selfLink: ""
~~~
#### backup target Filters
You can use [resource filtering](https://velero.io/docs/main/resource-filtering/) options to backup specific resources. Typical ones are following;
- labelSelector: Specify the labels for the backup target resources
MatchExpression has several operators such as In, NotIn, Exists and DoesNotExist.
- includeClusterResources:(Boolean) Set true to include PV
- includedNamespaces: Specify the namespaces in which backup target resources are included
- includedResources: Specify the resource types for the backup target resources
**NOTE**: You have to select the resource filters properly. For example, if the target application has cluster-scope resources, then you cannot use `--include-namespaces` only.
#### backup destination
- snapshotVolumes:(Boolean) Set true for volume snapshotting
- storageLocation: Backupstoragelocation CR name
Expand All @@ -102,15 +104,19 @@ Create a restore with your most recent Velero Backup:
~~~
velero restore create --from-backup <SCHEDULE NAME>-<TIMESTAMP>
~~~
If you want to restore specific resources, you can use [resource filtering](https://velero.io/docs/main/resource-filtering/).
For example, you can restore resources in `web` namespace:
```
velero restore create --from-backup <SCHEDULE NAME>-<TIMESTAMP> --include-namespaces web
```

When ready, revert your backup storage location to read-write mode:
~~~
kubectl patch backupstoragelocation <STORAGE LOCATION NAME> \
--namespace velero \
--type merge \
--patch '{"spec":{"accessMode":"ReadWrite"}}'
~~~

#### restore target filter
If you want to restore specific resources, you can use [resource filtering](https://velero.io/docs/main/resource-filtering/).
For example, you can restore resources in `web` namespace:
```
velero restore create --from-backup <SCHEDULE NAME>-<TIMESTAMP> --include-namespaces web
```
**NOTE**: You have to select the resource filters properly. For example, if the target application has cluster-scope resources, then you cannot use `--include-namespaces` only.

0 comments on commit d1bfef0

Please sign in to comment.