Skip to content

External ArgoCD

In most cases you will not want to run ArgoCD, the deployment tool/engine on the same cluster that is hosting your workload. The Quick Start used the apps/aio-app-of-apps.yaml to initialize ArgoCD using the App of Apps pattern.

An existing deployment

To switch to an External ArgoCD for an existing deployment you must first disable your existing ArgoCD from deleting or updating any applications.

cat << EOF | kubectl -n argocd patch --type json --patch-file /dev/stdin appset app-of-apps
- op: replace
  path: "/spec/template/spec/syncPolicy/automated/prune"
  value: false
- op: replace
  path: "/spec/template/spec/syncPolicy/automated/selfHeal"
  value: false
EOF

Then we must perform the same step but on all the children ApplicationSets and remove their finalizers.

for appset in $(kubectl -n argocd get appset -o name); do
    cat << EOF | kubectl -n argocd patch --type json --patch-file /dev/stdin "${appset}"
- op: replace
  path: "/spec/template/spec/syncPolicy/automated/prune"
  value: false
- op: replace
  path: "/spec/template/spec/syncPolicy/automated/selfHeal"
  value: false
- op: remove
  path: "/metadata/finalizers"
EOF
done

Now we are ready to remove ArgoCD from our existing cluster.

kubectl delete ns argocd

You are now ready to deploy Understack in your external ArgoCD.

Deploying Understack in an external ArgoCD

If you did not have Understack already deployed with an ArgoCD in cluster or you followed the removal steps above, you are ready for this section.

Firstly you must create a cluster configuration for the Understack App of Apps which can be done by treating your setup like an extra region. Once you've created your cluster config and loaded it into your ArgoCD then you can load the Understack app-of-apps into your ArgoCD with:

kubectl -n argocd apply -f apps/app-of-apps.yaml

If you followed the Quick Start, you will notice the slightly different filename. The leading aio is removed which stands for All In One.