docs

Backups Enterprise

Every pack can back up its databases to an S3 bucket outside your cluster. Enterprise adds every volume to that bucket, a rebuild on a new cluster, and nightly Velero backups inside the cluster, to undo a mistake fast.

EnterpriseBackups are included in the Enterprise pack. See the Enterprise pack →

BACKUPSScheduled backupevery night, 02:00 UTCManual backupbefore a risky changeSTORES INSeaweedFS S3inside the clusterVelero

BACKUPS

  • Scheduled backupevery night, 02:00 UTC
  • Manual backupbefore a risky change

Velero runs the backup

Velero

It stores them in SeaweedFS, in the cluster

  • SeaweedFS S3inside the cluster
These stay in the cluster. Your databases (every pack) and, with Enterprise, your volumes also go to your S3 bucket outside it. To restore, pause ArgoCD first: otherwise it recreates the app with empty volumes.

Two kinds of backups

  • Databases, in every packCloudNativePG archives each database continuously to your S3 bucket outside the cluster, once you set one. A database comes back to a moment you pick. Backups to S3.
  • Volumes and the whole platform, with EnterpriseEvery volume is copied to the same bucket, and you can rebuild the whole platform on a new cluster from your Git repo, the bucket and your key file. See Enterprise.
  • Inside the cluster, with EnterpriseVelero, every night: the fast way to undo a mistake, such as a deleted namespace or a bad upgrade. The rest of this page covers it.

Use case

An engineer deletes an app's namespace by mistake. The app keeps user files on a volume.

A deleted namespace, without and with backups
StepWithoutWith Backups
MistakeThe namespace and its volumes are gone.Last night's backup holds the namespace and its volumes.
RedeployArgoCD recreates the app from Git, with empty volumes.You pause ArgoCD so it does not recreate the app empty.
RestoreThe data comes back only if someone copied it by hand.One Velero command restores the namespace and its volumes.
Back to workThe team reloads whatever data it can find.You resume ArgoCD. The app runs with last night's data.

What is backed up

  • Every nightAt 02:00 UTC, every namespace except kube-system and velero, volumes included. Kept 7 days.
  • Inside the clusterIn the SeaweedFS S3 store. Lose the cluster and you lose these: the backups outside it are for that.
  • DatabasesVelero copies their files while Postgres is running, which is not a database backup. The databases' own backups go to your bucket outside the cluster, continuously, once you turn them on.

To change the schedule, edit schedules in helm/platform/velero/values.yaml and push.

Run Velero commands

The Velero CLI is in the server pod. The commands pick that pod by its label, because deploy/velero can land on a node-agent pod.

# The backup store: phase Available
kubectl -n velero exec "$(kubectl -n velero get pod -l name=velero -o name | head -1)" -c velero -- /velero backup-location get

# The backups: velero-daily-<timestamp>, one per night
kubectl -n velero exec "$(kubectl -n velero get pod -l name=velero -o name | head -1)" -c velero -- /velero backup get

Before a risky change, back up the app yourself:

kubectl -n velero exec "$(kubectl -n velero get pod -l name=velero -o name | head -1)" -c velero -- /velero backup create hello-now --include-namespaces hello --ttl 168h --wait

Restore a namespace

The example restores hello. Never delete the argocd namespace.

  1. Pick a backup

    Note the newest backup taken before the mistake: velero-daily-<timestamp>, or hello-now if you made one.

    kubectl -n velero exec "$(kubectl -n velero get pod -l name=velero -o name | head -1)" -c velero -- /velero backup get
  2. Pause ArgoCD

    Otherwise ArgoCD recreates the app from Git within seconds, with empty volumes. No app syncs until step 4.

    kubectl -n argocd scale statefulset argocd-application-controller --replicas=0
  3. Delete and restore

    ArgoCD may already have recreated hello with empty volumes. Delete it, even if you deleted it before.

    kubectl delete namespace hello --ignore-not-found
    
    # <backup>: the backup you picked in step 1
    kubectl -n velero exec "$(kubectl -n velero get pod -l name=velero -o name | head -1)" -c velero -- /velero restore create --from-backup <backup> --include-namespaces hello --wait
    
    kubectl -n hello get pods
  4. Resume ArgoCD

    kubectl -n argocd scale statefulset argocd-application-controller --replicas=1