argoproj / argo-cd

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

auto prune `notified.notifications.argoproj.io` annotation #13097

Open ghost opened 1 year ago

ghost commented 1 year ago

Summary

Currently the ArgoCD sends notification emails when deployment is complete.

However, this annotation is not currently cleaned up, and the Application object will gradually expand as new applications are released.

Motivation

Proposal

Add a policy to automatically clean up historical data

mateuszkozakiewicz commented 1 year ago

Similar issue, when using oncePer: "[app.spec?.source?.helm['values']]" with large helm values it makes the annotation grow very fast and quickly leads to Application.argoproj.io is invalid: metadata.annotations: Too long: must have at most 262144 bytes

Any advice how to resolve this? I would be perfectly fine with keeping only the latest state to compare, so when I roll back to previous configuration I would be notified again.

git-ljm commented 10 months ago

Does anyone care about this? I think it's a risk point.

mateuszkozakiewicz commented 10 months ago

Can you explain? The default behavior causes notifications to soon stop working correctly (it notifies on every tick..) when notifying for a large app. I had to use a workarounds like notifying on annotation changed oncePer: "[app.metadata.annotations['helm-values-checksum'], app.metadata['name']]" and on the application resource

annotations:
  helm-values-checksum: {{ adler32sum (.Files.Get (printf "%s/%s" "values" (base (printf "%s" $.Template.Name)))) | quote }}

Even this solution will fill up the annotation at some point but it will take years, but my applications are deployed and developed for years.

therapy-lf commented 10 months ago

Hi, we have a very similar situation. Is there any solution to that?

jerryqzhang commented 2 months ago

Hi, we have a very similar situation. Is there any solution to that?