Recovery & export¶
Once a namespace backup is performed, one can browse its contents in the Afi portal, export configuration manifests from the backup, and recover namespace configuration and persistent volume state from the backup.
To access a backup, click on the Recover button next to the corresponding namespace protection:
The backup browser screen has two tabs, Manifests and Volumes. Manifests lists objects with the configuration of applications deployed in a protected namespace. Volumes lists snapshots of persistent volume claims.
Recovery¶
During a recovery Afi lets you choose objects to restore and the destination namespace.
The following recovery destinations are supported:
- to the original namespace,
- to another (existing) namespace,
- to a new namespace (created by the Afi service during the recovery).
Please note that a restore overwrites objects in the destination namespace.
Both configuration and persistent volume data can be restored with any granularity. The following scenarios are typical:
- Restore the all application configuration and all persistent volumes.
- Restore application configuration only.
- Restore persistent volumes only. This is useful for applications that are deployed with policy-as-code approach, but depend on persistent state.
- Restore individual configuration objects. For example, you can recover a specific Secret after the old one was accidentally deleted.
- Restore all configuration objects of a specific kind, for example, restore all ConfigMaps.
- Restore all objects that match a label selector, for example, restore all configuration objects with label
deployment=prod
. - Restore all objects except ones that have a specific label, for example, exclude all objects with label
version=beta
.
To start a restore, click Recover button. By default, the recover dialog assumes that all configuration manifests and all persistent volumes are to be restored. Choose a destination namespace for a restore, and click Recover.
Before you open the recovery dialog you can select individual manifests or manifest kinds. In this case only selected manifests or manifest kinds will be restored.
You can also define custom selectors that choose what manifests to restore. Click Advanced settings in the recovery dialog to define custom selectors. A selector can choose manifests that match the following criteria:
- API group and version,
- kind,
- name,
- label selector.
Criteria in a selector are ANDed. For example, if a selector has a non-empty value for kind, and a non-empty label selector, it will choose manifests of the given kind that match the label selector.
Selectors are applied sequentially, first-to-last.
Once you start a restore operation, you can monitor it on the Activity → Tasks tab in the Afi portal, and you will receive an email notification when the recovery is completed.
See a few examples below:
Export¶
Application configuration can be exported from backups in the YAML format. Click Download to export all manifests as a single YAML. If you want to export only specific manifests, select them on the browser screen, and then click Download.
Please note that you may need to enable pop-ups for app.afi.ai to download the result of an export.