argoproj / applicationset

The ApplicationSet controller manages multiple Argo CD Applications as a single ApplicationSet unit, supporting deployments to large numbers of clusters, deployments of large monorepos, and enabling secure Application self-service.
https://argocd-applicationset.readthedocs.io/
Apache License 2.0
584 stars 278 forks source link

ApplicationSet requeueAfterSeconds is being ignored #593

Open mgoodness opened 2 years ago

mgoodness commented 2 years ago

We have several ApplicationSets defined with the git generator and have set requeueAfterSeconds to reduce the polling. The applicationset controller is logging the new setting but continues to poll every 3 minutes. We are running release 0.4.1 of the ApplicationSet Controller.

Logs

{"generator":{"git":{"repoURL":"git@github.mlbam.net:Test-Services/gitops-argocd.git","directories":[{"path":"releases/prod/us-central1/prod-test/*"}],"revision":"test","requeueAfterSeconds":1200,"template":{"metadata":{},"spec":{"source":{"repoURL":""},"destination":{},"project":""}}}},"level":"info","msg":"generated 27 applications","time":"2022-07-12T17:09:01Z"}
{"generator":{"git":{"repoURL":"git@github.mlbam.net:Test-Services/gitops-argocd.git","directories":[{"path":"releases/prod/us-central1/prod-test/*"}],"revision":"test","requeueAfterSeconds":1200,"template":{"metadata":{},"spec":{"source":{"repoURL":""},"destination":{},"project":""}}}},"level":"info","msg":"generated 27 applications","time":"2022-07-12T17:11:15Z"}

Appset Config

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: test-prod-releases-prod-test-us-central1
  namespace: argocd
spec:
  generators:
    - git:
        requeueAfterSeconds: 1200
        repoURL: git@github.myorg.net:Test-Services/gitops-argocd.git
        revision: test
        directories:
          - path: 'releases/prod/us-central1/prod-test/*'
juangb commented 1 year ago

We are suffering the exact same issue, running version v2.6.0.

Containers:                                                                                                                                           
  applicationset-controller:                                                                                                                          
     Container ID:  docker://fd2feeb73a7fa265491e880bd1316956ffbeca571882ae5e3c9c3866b498e1e1                                                           
     Image:         quay.io/argoproj/argocd:v2.6.0                                                                                                    
     Image ID:      docker-pullable://quay.io/argoproj/argocd@sha256:ce98a41a5656938a6f07e23d446d948b321f36c9c3638e9c08d37ff500777995   

The applicationset-controller keeps polling (git fetch ...) even though the field requeueAfterSeconds was drastically increased.

juangb commented 1 year ago

Same as: https://github.com/argoproj/argo-cd/issues/12457. The problem we are having is not that the field requeAfterSeconds is ignored, but that Applications syncs are triggering redundant reconciles of the ApplicationSet.

rumstead commented 1 year ago

https://github.com/argoproj/argo-cd/issues/12407 can we see if this PR addresses it? I have a feeling it doesn't but similar issue.

juangb commented 1 year ago

It is solved by: https://github.com/argoproj/argo-cd/pull/12480. Note that we are not mentioning a matrix generator with a cluster generator in this issue (as in https://github.com/argoproj/argo-cd/issues/12407). In our specific setup, we have one argo instance per cluster, and each one has an applicationset with a git path generator.

The problem about the redundant reconciles was causing that every time the application-controller processed the apps, the applicationset was triggered for reconcile.