How am I supposed to do application-aware-backups and restores? #7419
-
We have a AKS cluster running with Velero. Our idea is to use Velero for application-aware backups. Our app consists of a Python app that creates some PDFs in a PVC with Azure-backed CSI disks, and a Database running on its own CSI disk. Since filesystem snapshots are insufficient for reliable database backups, we create a SQL dump file before backing up a volume, and store it in the same volume as the PDFs, so we have everything in one place. Therefore, we have the following requirements:
As long as we have a dump in the PDF volume, we don't care if the volume is backed with FSB or CSI, whatever works better and is only billed once. What I have right now:
The backup seems to work:
I'm having trouble with the restore.
It's stuck. Specifically, it's stuck in PVC How can I restore the filesystem in the volume to the last backup so that the next pod restart sees the recovered files? Edit: apiVersion: v1
kind: ConfigMap
metadata:
name: restore-pvc-patch
namespace: velero
data:
resource-patch.yaml: |
version: v1
resourceModifierRules:
- conditions:
groupResource: persistentvolumeclaims
patches:
- operation: remove
path: "/spec/volumeName" and started restore using Why is it so hard to do a simple file restore? This doesn't seem to be a niche use case. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have found a solution. I went back to CSI Snapshots. However, this time I'm using the resource filter approach. apiVersion: v1
kind: ConfigMap
metadata:
name: volume-policy
namespace: velero
data:
resource-policy.yaml: |
version: v1
volumePolicies:
- conditions:
storageClass:
- managed-csi-no-backup
action:
type: skip Further, the Pod annotation The restore is a bit more complicated:
|
Beta Was this translation helpful? Give feedback.
I have found a solution.
I went back to CSI Snapshots. However, this time I'm using the resource filter approach.
I created another Storage Class that the DB uses. This storage class is excluded by this policy:
Further, the Pod annotation
backup.velero.io/backup-volumes
is removed, otherwise it's still using FSB.The restore policy to remove the volume name is also not required.
The hook to create a SQL dump is still working.
The resto…