|
3 months ago | |
---|---|---|
.gitignore | 5 months ago | |
README.md | 3 months ago | |
backup.py | 4 months ago | |
config.template | 5 months ago | |
requirements.txt | 5 months ago |
(Kubernetes Rados Block Device Backup)
Backups any persistent kubernetes volumes, static and dynamically created ones. Using the rbd
tool in cephadm install ceph-common
. It will leave you with fully functional images, that can be either
manually mounted to recover data, or directly inserted in an existing ceph cluster.
Copy the config template and fill in your own values (name it just config
after and place it next to the backup.py script)
Edit /etc/fstab
# Ext Harddrive for backups
/dev/sda1 /restore/ auto defaults,nofail 0 2
Parameters
lsblk
You will want the script to run automatically. Do that by creating a simple root user crontab using sudo crontab -e
and append the file something like this
# every day at 1 am
0 1 * * * cd /home/tobi/backup && python3 backup.py
Crontabs are stored under /var/spool/cron/crontabs
incase you want to modify that.
sudo mount /path/to/backup.img /path/to/empty/folder
rbd import --image-feature layering backup.img pool/new-image-name
The image feature is especially important. Images that you want to mount into kubernetes pods have to have the layering
feature and only that.
The running user needs to have access to backup_path
specified in the config file
python3 backup.py