Files
velero/site/content/docs/v1.5/disaster-case.md
Nolan Brubaker 87d86a45a6 Add changelog and docs for v1.5 release (#2941)
* Add changelog and docs for v1.5 release

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Fix markdown indentation

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Fix URLs with patch version

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Fix example link

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-09-16 17:17:30 -04:00

1.7 KiB

title, layout
title layout
Disaster recovery docs

Using Schedules and Read-Only Backup Storage Locations

If you periodically back up your cluster's resources, you are able to return to a previous state in case of some unexpected mishap, such as a service outage. Doing so with Velero looks like the following:

  1. After you first run the Velero server on your cluster, set up a daily backup (replacing <SCHEDULE NAME> in the command as desired):

    velero schedule create <SCHEDULE NAME> --schedule "0 7 * * *"
    

    This creates a Backup object with the name <SCHEDULE NAME>-<TIMESTAMP>. The default backup retention period, expressed as TTL (time to live), is 30 days (720 hours); you can use the --ttl <DURATION> flag to change this as necessary. See how velero works for more information about backup expiry.

  2. A disaster happens and you need to recreate your resources.

  3. Update your backup storage location to read-only mode (this prevents backup objects from being created or deleted in the backup storage location during the restore process):

    kubectl patch backupstoragelocation <STORAGE LOCATION NAME> \
        --namespace velero \
        --type merge \
        --patch '{"spec":{"accessMode":"ReadOnly"}}'
    
  4. Create a restore with your most recent Velero Backup:

    velero restore create --from-backup <SCHEDULE NAME>-<TIMESTAMP>
    
  5. 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"}}'