3.2 KiB
19 - Backup and Restore
This section is a WIP, please do NOT consider this to be either finished or working.
Backup
Creating Frequent Backups
SCALE includes an integrated system to backup the kubernetes objects as well as make snapshots of the PVC
and ix_volume
storage.
However, it does NOT create these outside of SCALE upgrades.
To create daily backups of the kubernetes objects, create the following Cron Job:
Exporting Backups
The above only creates only a backup of the kubernetes objects and a snapshot of the PVC
and ix_volume
storage.
It does not protect these against, for example, deletion of datasets or save them on an external system.
We highly advice making both an internal backup (seperate dataset on the same system) and an offsite backup.
One could create a normal recursive(!) replication of the ix-volumes
dataset using the SCALE GUI, with the following few special tricks by editing the replication after creation:
- Exclude the docker images:
- Include any snapshots made by the above backup task
It's also important to ensure you keep regular config backups of the SCALE system itself, preferably right after the Apps backup above). However this is not part of this guide and we will assume you've done so yourself.
Checking Backups
To make which backups are present, one can use the following command in a shell:
cli -c "app kubernetes list_backups"
Restore
One of the most important parts of backups is to ensure they can be restored. There are two scenario's for a restore:
-
Reverting a working system
-
Total System Restore
Reverting a running system
Reverting a running system is rather trivial. But there are a few caveats:
- This will reinitialise the kubernetes node, which means all kubernetes objects that are not deployed using the Apps system will get reverted
- You CANNOT revert a single Apps
To revert an existing system, the process is as follows:
-
List your current backups using
cli -c "app kubernetes list_backups"
-
Pick a backup to revert and note it's name
-
Run:
cli -c "app kubernetes list_backups { 'backup_name': 'BACKUPNAME'}
(where you replease BACKUPNAME with the name of the backup you selected above)
Total System restore
Sometimes you either need to wipe your Pool, Migrate to a new Pool or restore a system completely. With the above steps this is all very-much-possible.
-
Do not initiate the (select a pool for) Apps system yet.
-
Optional: When the SCALE system itself is also wiped, ensure to restore it using a SCALE config export first.
-
Using ZFS replication, move back the previously backed-up
ix-applications
dataset. -
Continue with the steps listed on
Reverting a running system
Video Guide
TBD