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?

all 6 comments

sorted by: hot top controversial new old
[–] 6 points 1 year ago (2 children)
  • [–] 4 points 1 year ago*

    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

  • source
  • [–] 2 points 1 year ago* (last edited 1 year ago)

    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.

  • source
  • 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.

  • source