How do you manage backup for kubernetes persistent volumes?
from rgalex@lemmy.world to selfhosted@lemmy.world on 12 Aug 08:51
https://lemmy.world/post/34324694

I’ve been configuring my own selfhosted Kubernetes cluster with various raspberry pis, and for applications that require persistence, I rely on NFS as a provider for Persistent Volumes.

Now I want to deal with backups of my data, mainly the multmedia library I’m building with Jellyfin.

I’m thinking about just doing something outside kubernetes that just copies the data from the directory that NFS provides to another storage.

If you’ve done something similar, what’s your approach? There are solutions that can be done inside kubernetes?

#selfhosted

threaded - newest

huangrydude@lm.boing.icu on 12 Aug 09:04 next collapse

I use Longhorn for generic PVC and static NFS shares for large files. Longhorn creates scheduled backups to a NFS share, which is then backed up to a Backblaze bucket. I have yet to test restore from Backblaze tho :D

Of course this means that I have 3 copies of the same data across multiple Nodes because of how Longhorn works. That’s why I usually don’t create large volumes, just enough to get the app working

doeknius_gloek@discuss.tchncs.de on 12 Aug 09:57 next collapse

I’m thinking about just doing something outside kubernetes that just copies the data from the directory that NFS provides to another storage.

This is what I’m doing for the most part. A TrueNAS server provides the NFS shares and periodically backs them up with restic.

Some apps don’t like NFS very much, especially those that require SQLite. If you’re running Jellyfin over NFS you probably know what I mean. For those apps I use Ceph instead, which is highly available and a lot faster but also more complicated. Those PVCs I backup from within kubernetes to S3 storage with velero.

SuperiorOne@lemmy.ml on 12 Aug 10:52 next collapse

For media files (bad idea for databases), I’m using Kubernetes CronJobs with restic. It mounts PVC to the cron job pod and backups target directories to S3 storage.

seang96@spgrn.com on 12 Aug 11:22 collapse

Velero is the backup solution for PVCs and k8s way.

Hagenman@lemmy.world on 12 Aug 16:44 next collapse

A lot of commercial kubernetes backup tools incorporate Velero for portions of their protection methods too!

rgalex@lemmy.world on 13 Aug 07:51 collapse

Interesting! I’m using in fact the NFS CSI driver, and it seems that Velero can attach to any CSI interface to make backups. I’m definetely taking a look at it.