Hey everyone! I've recently made the upgrade from a single-node MariaDB setup to a Bitnami MariaDB Galera cluster running on Kubernetes. Before this, I used a simple CronJob with mariadb-dump every 10 minutes, saving the dumps to a PVC, which worked perfectly for me.
Now, as I dive into Galera, I'm on the hunt for the best approach to back up my databases—not just doing snapshotting of the persistent volumes with Velero. Here are my goals for backups:
- I'm looking for logical or physical backups that are easy to restore into a new cluster if necessary.
- I need to ensure consistent backups across the cluster. While only one node matters since they're in sync, I want to avoid issues if one pod is down.
- Simplicity in management is key; I don't want this to become a massive operating headache.
- Bonus points if the restore process is quick and straightforward!
I hear that mariadb-backup is the go-to for Galera, but integrating that with Kubernetes seems a little clunky with things like CronJobs, handling pods/PVCs, and ensuring node sync.
How are you all managing MariaDB Galera backups in K8s?
- Are you running mariabackup inside pods (like as a sidecar or init container)?
- Do you exec into a StatefulSet pod from a CronJob?
- Or are you sticking with logical dumps (like mariadb-dump) despite Galera's setup?
- Any tips to make the restore process less of a hassle?
Looking forward to hearing your experiences or best practices. Thanks!
3 Answers
One effective method I’ve seen is running mariabackup as a sidecar in your StatefulSet pods. This keeps everything contained, and you can manage backups without needing to exec into a pod manually. Just remember to handle node sync properly to avoid issues!
It sounds like you're in a bit of a transition! I totally get the desire for a smooth backup process. Ideally, using the mariadb-operator could simplify a lot of the backup and restore headaches. It supports both logical and physical backups and is designed to handle day-two operations much better than just a plain helm chart.
Totally agree! The automated recovery features are a massive bonus with the mariadb-operator as well.
I still prefer using logical dumps for backups, mainly because they're simpler and more familiar for restores, despite Galera's complexity. You can set up your CronJobs to run periodic mariadb-dump, ensuring you handle any pod down scenarios by having a simple failover logic in place. It’s worked well in my setups!
Just make sure to have a solid backup schedule; it really helps during restorations.

That sounds super manageable! I'll definitely look into setting it up as a sidecar.