argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
16.82k stars 5.09k forks source link

CRDs do not get the correct tracking annotation #17400

Open mikebryant opened 4 months ago

mikebryant commented 4 months ago

Checklist:

Describe the bug

CustomResourceDefinition objects do not get the argocd.argoproj.io/tracking-id annotation, as described in the docs

We want to explicitly allowlist CRDs for certain AppProjects using a kyverno policy so we can delegate control, without allowing someone to modify any CRD. ( clusterResourceWhitelist only lets us do this by type, not by name)

We were hoping to use the tracking annotation to specify which were allowed for which projects - but have now found it's not available

To Reproduce

Deploy a CRD

Expected behavior

CustomResourceDefinitions should have this annotation added

Screenshots

Version

Paste the output from `argocd version` here.

v2.9.5

Logs

Paste any relevant application logs here.

Debugging

It looks like it's explicitly exclude here but there's no indication as to why

mikebryant commented 4 months ago

Also see https://github.com/argoproj/argo-cd/issues/12208

sedflix commented 3 months ago

I'm facing the same issue. CRD doesn't contain any tracking labels or annotations. Therefore "FailOnSharedResource=true" doesn't work with CRD; the one resource on which it's a must.

Is there any particular reason why no tracking labels or annotations are present on CRDs?

mjgallag commented 2 months ago

I would also prefer they be tracked as not tracking them appears to be causing reconciliation delays upon creation, particularly with charts that contain only CRDs (likely an edge case) such as istio-base where the first reconciliation only sees some of them and then you have to wait 5mins for rest to appear even though they were established less then a second after the initial reconciliation. Seems not tracking was done over concerns of deletion but we could block deletion by default while still tracking.

faust64 commented 2 months ago

I'm just noticing the same thing: no tracking annotations on CRDs that were installed by ArgoCD. Moreover, I observed that if my Application used to install some CustomResourceDefinition, then I remove that from my code: ArgoCD doesn't tell me my app is OutOfSync. Doesn't seem to realize that CRD was ever part of my Application.

todaywasawesome commented 2 weeks ago

Recommendations from contributors meeting