by vbezhenar · 3y ago · 0 comments
As I see it: I write some kind of configuration.
someproject-db is a deployment which runs a postgres db. Tool should connect to this DB, issue some kind of pg_backup command, capture output, retrieve some metadata about previous backup from S3, compute difference with previous run, compress that difference and store it to S3.
anotherproject is a deployment which runs an sqlite db. Tool should do the same but with sqlite-specific commands.
yetanotherproject-data is a pvc which has attached pv. Tool should find pod which mounted this volume, exec into that pod and retrieve pv data, again find different and store it to S3.
Of course things should be configurable. Like store difference every 15 minutes, store complete backup every week and so on.
I'm fine with manual recover and with manual configuration (I just don't want to write and test all the scripts myself).
What I don't want is some kind of magic tool which will backup the entire cluster, etcd and my grandparents automatically in some magic way only for $50k/cpu core.
Borgmatic will beautifully deal with DB dumps and there is a popular container image to run it. As for the cache ("retrieve some metadata about previous backup from S3"), you don't need to keep it locally. It can be restored from the backup repository.
Hope some of this applies to your K8s setup.
My suggestion is using ZFS.
I use Borg as backup of backup (zfs snapshots), so I'll be having multiple implementations of backups (also both are on different remote location) just to be on the safe side.
I don't use any other fancier ones as I don't like risking data on less reliable tools.
How does it matter if anyone else is using zfs? You either use a service that supports zfs target or run your own Linux instance which is just installing a single package for Ubuntu.