vmware-tanzu / helm-charts

Contains Helm charts for Kubernetes related open source tools
https://vmware-tanzu.github.io/helm-charts/
Apache License 2.0
254 stars 362 forks source link

Volume snapshots and File System Backup at the same time? #529

Open igorhrcek opened 11 months ago

igorhrcek commented 11 months ago

Describe the problem/challenge you have I've added the annotation backup.velero.io/backup-volumes: data to all deployments that I want to back up using file system backup. However, the velero is not doing a snapshot of those volumes at all.

Describe the solution you'd like I would like to configure the velero to do both things - snapshots and file system backups, at the same time.

Anything else you would like to add: This is how Velero is currently configured:

---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: velero
  namespace: velero
spec:
  chart:
    spec:
      # renovate: registryUrl=https://vmware-tanzu.github.io/helm-charts chart=velero
      version: 5.1.5
  values:
    deployNodeAgent: true
    credentials:
      useSecret: true
      existingSecret: velero

    configuration:
      backupStorageLocation:
        - name: default
          provider: gcp
          bucket: production-bucket
          credential:
            name: velero
            key: velero-sa.json

      volumeSnapshotLocation:
        - name: default
          provider: gcp
          uploaderType: restic
          defaultBackupStorageLocation: default
          credential:
            name: velero
            key: velero-sa.json

    schedules:
      sites:
        enabled: true
        schedule: "0 1 * * *"
        template:
          ttl: "720h"
          storageLocation: default

It is not obvious from the chart itself how this can be achieved. If I omit the annotation from one of the deployments, snapshots are being created.

Environment:

sseago commented 11 months ago

"I would like to configure the velero to do both things - snapshots and file system backups, at the same time." If you mean back up the same PVC with both snapshots and fs backup, then that's not supported. If you mean you want to back up some volumes with snapshots and others with fs backup, that is supported either via opt-in or opt-out.

Note that the opt-in annotation you mention above needs to be on the pod, not the deployment -- so on your deployment, you should add backup.velero.io/backup-volumes: data to your Deployment's spec.template.metadata.annotations field rather than metadata.annotations -- that will ensure that any pods created by the deployment will have the proper opt-in fs backup annotation.

igorhrcek commented 11 months ago

Hey @sseago thanks for the prompt answer. It is a shame that FSB and doing snapshots are mutually exclusive.

I have one additional question related to the configuration of the schedule - there is includedNamespaces: that can be used for namespace filtering, can I pass something like ih-* to include all namespaces that start with ih-?