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 →
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
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.
| Step | Without | With Backups |
|---|---|---|
| Mistake | The namespace and its volumes are gone. | Last night's backup holds the namespace and its volumes. |
| Redeploy | ArgoCD recreates the app from Git, with empty volumes. | You pause ArgoCD so it does not recreate the app empty. |
| Restore | The data comes back only if someone copied it by hand. | One Velero command restores the namespace and its volumes. |
| Back to work | The 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-systemandvelero, 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.
Pick a backup
Note the newest backup taken before the mistake:
velero-daily-<timestamp>, orhello-nowif you made one.kubectl -n velero exec "$(kubectl -n velero get pod -l name=velero -o name | head -1)" -c velero -- /velero backup get
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
Delete and restore
ArgoCD may already have recreated
hellowith 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
Resume ArgoCD
kubectl -n argocd scale statefulset argocd-application-controller --replicas=1