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 fails silently #633

Closed fbueno closed 1 year ago

fbueno commented 1 year ago

I have the following ApplicationSet that worked at some point. But I have no idea what I changed in order to it to stop working (creates no Application when the patterned branch is pushed):

---
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: xxxxx
spec:
  generators:
  - scmProvider:
      cloneProtocol: ssh
      filters:
        - repositoryMatch: helm
          branchMatch: "^xxxx-.*"
      github:
        organization: xxxx
        allBranches: true
        tokenRef:
          secretName: github
          key: token
  template:
    metadata:
      name: '{{ branch }}'
      namespace: inf-argocd
    spec:
      project: default
      source:
        repoURL: 'git@github.com:xxxxx/helm.git'
        path: "applications/xxxxxx-0-us-east1-development/.xxxxx/{{ branch }}"
        targetRevision: '{{ branch }}'
        directory:
          recurse: false
          jsonnet: {}
      destination:
        server: 'https://kubernetes.default.svc'
        namespace: inf-argocd
      syncPolicy:
        automated: {}
        syncOptions:
          - CreateNamespace=true
          - PrunePropagationPolicy=foreground
          - PruneLast=true
        retry:
          limit: 5
          backoff:
            duration: 5s
            factor: 2
            maxDuration: 3m

If I set no github secret I get from the applicationset-controller pod:

time="2023-05-08T22:11:08Z" level=error msg="error generating application from params" error="error listing repos: error listing repositories for xxxxxx: GET https://api.github.com/orgs/xxxxx/repos?per_page=100: 403 API rate limit exceeded for x.x.x.x. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) [rate reset in 59m54s]" generator="{<nil> <nil> <nil> 0xc001003520 <nil> <nil> <nil> <nil>}"

If I do set the secret I get only:

time="2023-05-08T22:28:20Z" level=info msg="ApplicationSet controller v2.4.11+3d9e9f2 using namespace 'inf-argocd' namespaceinf-argocdCOMMIT_ID3d9e9f2f95b7801b90377ecfc4073e5f0f07205b"
I0508 22:28:21.117833       7 request.go:665] Waited for 1.038972122s due to client-side throttling, not priority and fairness, request: GET:https://10.145.32.1:443/apis/xxxxx/v1?timeout=32s
time="2023-05-08T22:28:21Z" level=info msg="Starting configmap/secret informers"
time="2023-05-08T22:28:21Z" level=info msg="Configmap/secret informer synced"
time="2023-05-08T22:28:21Z" level=info msg="Starting webhook server"
time="2023-05-08T22:28:21Z" level=info msg="Starting manager"
time="2023-05-08T22:28:33Z" level=info msg="generated 0 applications" generator="{<nil> <nil> <nil> 0xc000963a00 <nil> <nil> <nil> <nil>}"
time="2023-05-08T22:28:33Z" level=debug msg="apps from generator: []" generator="{<nil> <nil> <nil> 0xc000963a00 <nil> <nil> <nil> <nil>}"
time="2023-05-08T22:28:33Z" level=info msg="end reconcile" requeueAfter=30m0s
time="2023-05-08T22:28:44Z" level=info msg="generated 0 applications" generator="{<nil> <nil> <nil> 0xc00147e4e0 <nil> <nil> <nil> <nil>}"
time="2023-05-08T22:28:44Z" level=debug msg="apps from generator: []" generator="{<nil> <nil> <nil> 0xc00147e4e0 <nil> <nil> <nil> <nil>}"
time="2023-05-08T22:28:44Z" level=info msg="end reconcile" requeueAfter=30m0s

As I mentioned, it worked when I was using my feature branch for the whole cluster. This is the only meaningful thing I changed as far as I can remember.

The applicationset is indeed created, but no application below it. I wonder why I get no output at all when using a good (full access) API Token (personal).

dex: 2.30.2 argocd: 2.4.11

Any directions?