k8up
k8up copied to clipboard
Allow to Configure File Exclusions and Inclusions
Summary
As user of K8up I want to specify which files get included or excluded in a backup So that unneeded files (like temp files) do not get backed up unnecessarily
Context
Some applications may write temp files that shouldn't get backed up. For these use cases it is necessary to define exclusions. Currently all files of a PVC are backed up, there is no way to specify which ones to include or exclude.
Out of Scope
Further links
- https://restic.readthedocs.io/en/stable/040_backup.html#including-and-excluding-files
Acceptance criteria
Given a list of files to exclude is configured When a backup runs Then only applicable files are backed up
Implementation Ideas
The easiest way to define these is either on the deployment or the PVC. Whichever is more sensible. These exclusion lists must be passed to the wrestic container.
The PVC is the appropriate place. Objects in K8s have a size limit of 1 MB (actually etcd, but the outcome is the same). Large exclusion sets will not be possible. We could also store the exclusion definition in a ConfigMap and reference this ConfigMap f.e. via an annotation in the PVC.
This means that the wrestic container needs additional parameter handling to add exclusions to the backup command. Also the operator needs some logic to find and filter these annotations.
Here's the documentation how restic handles excludes: https://restic.readthedocs.io/en/stable/040_backup.html#including-and-excluding-files