How to exclude specific CSI volumes from backup? #8230
-
I have the same task as #7746: I would like to use the backup facilities of by PostgreSQL operator instead of velero to backup the persistent volume of my database. It's no problem to introduce a backup hook to trigger an operator backup, but still velero will also create a normal CSI snapshot and store it in S3 -- which wastes a lot resources. How do I exclude my PostgreSQL volumes from backup? I'm using the builtin velero CSI plugin for volume snapshots. The annotation Any ideas how to fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
You might be able to use volume policies (applying the |
Beta Was this translation helpful? Give feedback.
-
@Zalfsten Could you elaborate on your solution? I’m encountering the same issue. I'm trying to use the CloudNativeOperator alongside Velero. While backup and restore hooks aren't an issue, I'd like to exclude the backup of any PODs and PVCs associated with 'postgresql'. I also tried to write a custom velero plugin:
|
Beta Was this translation helpful? Give feedback.
backup.velero.io/backup-volumes-excludes
wouldn't help you -- that is intended to opt out of fs-backup (when that's the default) and use snapshots instead.You might be able to use volume policies (applying the
skip
policy) if the available filters are able to narrow down to just the PostgresQL volumes, although I don't know if that's enough to uniquely describe the volumes of interest in your case. Here's the doc for that:https://velero.io/docs/main/resource-filtering/#resource-policies