9.2 Backup and Restore

Backup and Restore

As ArgoCD holds the whole state in native Kubernetes objects it’s quite straightforward to make a backup and restore it in case of a disaster recovery.

ArgoCD provides the utility argocd-util which is used by ArgoCD internally. The functions export and import can be used for backup and restore of a ArgoCD instance.

As the tool is contained inside the ArgoCD server image you just can execute it from inside the container.

First find the current version used of ArgoCD server to align the server version with the tool version:

$ argocd version | grep server

argocd-server: v2.6.3+e05298b

Export the version (without the postfix +eb3d1fb) to environment:

export VERSION=v2.6.3

Backup

docker run -v ~/.kube:/home/argocd/.kube --rm argoproj/argocd:$VERSION argocd admin export > backup.yaml

Restore

The same utility can be used to restore a previously made backup:

docker run -i -v ~/.kube:/home/argocd/.kube --rm argoproj/argocd:$VERSION argocd admin import - < backup.yaml

Reference: Disaster recovery

Last modified September 24, 2024: Introduce techlab build (358840e)