Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Wait longer for the scheduled backup to start Jun 12, 2019
README.md Fix example cron schedule in README Jun 11, 2019
backup.rb Add backup/zfs cleanup scripts Jun 11, 2019
restore.rb Add backup/zfs cleanup scripts Jun 11, 2019
zfs-cleanup.sh Add backup/zfs cleanup scripts Jun 11, 2019

README.md

Velero/OpenEBS backup and restore

These are a couple of scripts to more easily use OpenEBS's Velero plugin so to include cStor volume snapshots in Velero backups. See https://github.com/openebs/velero-plugin for reference.

I use these scripts so I don't have to remember all the parameters and additional steps to correctly back up and restore namespaces that include OpenEBS cStor volumes.

Notes

  • When restoring, the --include-namespaces parameter is kinda ignored for volumes, while it works for everything else in the namespace. I was told by the OpenEBS devs that in order to be able restore only volumes for the selected namespaces I need to apply some label to the PVs before backing up and then use a selector during the restore to only take into account the selected namespaces. Therefore the backup script -before performing the actual backup or enabling a schedule- adds a label to the PVs in the selected namespaces with the format openebs.io/namespace=#{namespace}. The restore script then figures out which namespaces to ignore and uses a notin selector to skip restoring volumes in those namespaces;

  • The backup script excludes a couple of cert-manager related resources that otherwise will cause restores to fail when certificates are involved. This doesn't affect the restore of certificates etc which will work just fine after restoring;

  • The restore script sets the target ip of the volumes after restoring, as described in the link above;

  • The restore script, before restoring, cleans up any zfs volumes not deleted automatically when deleting pvcs; this is a known issue which will be fixed in the next OpenEBS release.

Usage

Backup

./backup.rb --backup <backup name> --include-namespaces <namespaces>

Schedule a backup

./backup.rb --backup <schedule name> --include-namespaces <namespaces> --schedule '0 5 * * *'

Restore

./restore.rb --backup <backup name> --include-namespaces <namespaces>
You can’t perform that action at this time.