Skip to content

Commit

Permalink
docs(velero): add documentation about velero backup restoration
Browse files Browse the repository at this point in the history
  • Loading branch information
alegrey91 committed Jul 2, 2021
1 parent eeae6fb commit 8d2ad3d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/operator/use-cases/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Bill, at Acme Corp. can use Capsule to address any of the following scenarios:
* [Taint Namespaces](./taint-namespaces.md)
* [Assign multiple Tenants to an owner](./multiple-tenants.md)
* [Cordoning a Tenant](./cordoning-tenant.md)
* [Velero Backup Restoration](./velero-backup-restoration.md)

> NB: as we improve Capsule, more use cases about multi-tenancy and cluster governance will be covered.
Expand Down
27 changes: 27 additions & 0 deletions docs/operator/use-cases/velero-backup-restoration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Velero Backup Restoration

Velero is backup system that perform disaster recovery, and migrate Kubernetes cluster resources and persistent volumes.

Using this in a Kubernetes cluster where Capsule is installed can lead to an incomplete restore of the cluster's Tenants. This is due to the fact that Velero omits the `ownerReferences` section from the tenant's namespace manifests when backup them.

To avoid this problem you can use the script `velero-restore.sh` under the `hack/` folder.

Below are some examples on how to use the script to avoid incomplete restorations.

## Getting Started

The first step we have to do is to create our tenant's namespaces backup using `velero-restore.sh`.

```bash
./velero-restore.sh --kubeconfig /path/to/your/kubeconfig backup
```

Once completed, you can find the tenant's namespaces backup under `/tmp/tenant_${tenant_name}`. Here we are saving the information required to complete the restoration later.

Now, in case of a data loss, the right thing to do is to restore the cluster with Velero at first. Once Velero has finished, you can proceed with the script to complete the restoration.

```bash
./velero-restore.sh --kubeconfing /path/to/your/kubeconfig restore
```

Running this command, we are going to patch the tenant's namespaces manifests that are actually `ownerReferences`-less. Once the command has finished its run, you got the cluster back.

0 comments on commit 8d2ad3d

Please sign in to comment.