Describe the bug
There is a problem using annotation-based resources tracking (see here) in the case of multiple ArgoCD instances.
When multiple ArgoCD instances have Applications with same name, it is impossible to differentiate their resources and Applications are in the infinite sync loop.
But ArgoCD already supports this scenario, but only with legacy label-base resource tracking (using application.instanceLabelKey). It would be great to support something like instanceLabelKey also with annotation-based resource tracking.
Related GitHub issue:
Annotation tracking method when multiple ArgoCD instances
Reproducer
First deploy two ArgoCD instances using helm chart and setting annotation-based resource tracking:
helm install argocd1 argo/argo-cd -n argocd1 --create-namespace --set "server.config.application\.instanceLabelKey=argocd.argoproj.io/instance-1" --set server.service.type=NodePort --set server.service.nodePortHttp=31080 --set server.service.nodePortHttps=31443 --set configs.cm."application\.resourceTrackingMethod"=annotation helm install argocd2 argo/argo-cd -n argocd2 --create-namespace --set "server.config.application\.instanceLabelKey=argocd.argoproj.io/instance-2" --set server.service.type=NodePort --set server.service.nodePortHttp=32080 --set server.service.nodePortHttps=32443 --set configs.cm."application\.resourceTrackingMethod"=annotation --set crds.install=false
Next create one Application per ArgoCD instance with same name:
kubectl create namespace helm-guestbook-1 kubectl create namespace helm-guestbook-2 cat <<EOF | kubectl create -f- apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: helm-guestbook namespace: argocd1 finalizers: - resources-finalizer.argocd.argoproj.io spec: destination: namespace: helm-guestbook-1 server: https://kubernetes.default.svc project: default source: path: helm-guestbook repoURL: https://github.com/argoproj/argocd-example-apps.git targetRevision: master syncPolicy: automated: prune: true selfHeal: true --- apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: helm-guestbook namespace: argocd2 finalizers: - resources-finalizer.argocd.argoproj.io spec: destination: namespace: helm-guestbook-2 server: https://kubernetes.default.svc project: default source: path: helm-guestbook repoURL: https://github.com/argoproj/argocd-example-apps.git targetRevision: master syncPolicy: automated: prune: true selfHeal: true EOF
Expected behavior
Expected behavior is same support for annotation based tracking like for label based annotation.
Version
argocd: v2.6.7+5bcd846.dirty BuildDate: 2023-03-23T17:25:30Z GitCommit: 5bcd846fa16e4b19d8f477de7da50ec0aef320e5 GitTreeState: dirty GoVersion: go1.20.2 Compiler: gc Platform: linux/amd64 argocd-server: v2.6.7+5bcd846 BuildDate: 2023-03-23T14:57:27Z GitCommit: 5bcd846fa16e4b19d8f477de7da50ec0aef320e5 GitTreeState: clean GoVersion: go1.18.10 Compiler: gc Platform: linux/amd64 Kustomize Version: v4.5.7 2022-08-02T16:35:54Z Helm Version: v3.10.3+g835b733 Kubectl Version: v0.24.2 Jsonnet Version: v0.19.1
- is related to
-
GITOPS-5432 Annotation tracking method when multiple ArgoCD instances
- New