Migrating Kubernetes Resources between ArgoCD Applications

3 years ago 5717 views
1 min read

I've been using ArgoCD for a while now, and as time went by I started to splitting my Kubernetes resources into smaller ArgoCD Applications. However, I could not figure out clear guidelines on how to do it without downtime. Recently I figured it out and wanted to share the solution.

First, disable auto-syncing so that neither of your ArgoCD Application sync. Then, remove the relevant code on Git from the ArgoCD Application that you want to migrate it from and push it to Git. Now ArgoCD will mark the resource for deletion but won't sync since auto syncing is disabled. Now, we can manually remove the ArgoCD label argocd.argoproj.io/instance and then it should be removed from ArgoCD's state and in the ArgoCD UI you should see the Kubernetes resources disappear. Now we move the relevant code on Git from the old ArgoCD Application to the new. Enable auto-syncing and the ArgoCD will add the ArgoCD label argocd.argoproj.io/instance with the value of the new Application. It won't change any of the Kubernetes resources unless you've explicitly done so when migrating the resources. Neither Applications will be out-of-sync and you can re-enable auto-syncing now.


Similar Posts

3 years ago
devops ci/cd jsonnet argo-cd tanka

GitOps with ArgoCD and Tanka

10 min read

GitOps is becoming the standard of doing continuous delivery. Define your state in Git, automatically update and change the state when pull requests are merged. Within the Kubernetes ecosystem two tools have become very popular for doing this FluxCD and …


3 years ago
devops ci/cd jsonnet argo-cd tanka vault

GitOps Secret Management with Vault, ArgoCD and Tanka

7 min read

Recently I wrote a blog post on how to use Grafana's Tanka with ArgoCD which is my prefered way to write Kubernetes configuration in Jsonnet. However, the post does not go into detail on the last missing piece - how …


5 years ago
mailgun statuscake terraform cloudflare devops s3 rds django

Kickstarting Infrastructure for Django Applications with Terraform

8 min read

When creating Django applications or using cookiecutters as Django Cookiecutter you will have by default a number of dependencies that will be needed to be created as a S3 bucket, a Postgres Database and a Mailgun domain.