Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable writing k8s events #18205

Closed
tooptoop4 opened this issue May 14, 2024 · 7 comments · Fixed by #18441
Closed

Option to disable writing k8s events #18205

tooptoop4 opened this issue May 14, 2024 · 7 comments · Fixed by #18441
Assignees
Labels
component:audit Information that helps use to track application history (app events, proj event etc) enhancement New feature or request good first issue Good for newcomers

Comments

@tooptoop4
Copy link

Summary

Environment variable/config to stop writing k8s events

Motivation

When i want to stop etcd filling up

Proposal

These parts of the code are writing k8s events which end up being stored in etcd:

EventReasonStatusRefreshed = "StatusRefreshed"
EventReasonResourceCreated = "ResourceCreated"
EventReasonResourceUpdated = "ResourceUpdated"
EventReasonResourceDeleted = "ResourceDeleted"
EventReasonResourceActionRan = "ResourceActionRan"
EventReasonOperationStarted = "OperationStarted"
EventReasonOperationCompleted = "OperationCompleted"

s.logAppEvent(a, ctx, argo.EventReasonOperationStarted, reason)

$ kubectl get events

@tooptoop4 tooptoop4 added the enhancement New feature or request label May 14, 2024
@rumstead
Copy link
Member

related #10529

@Jack-R-lantern
Copy link
Contributor

Jack-R-lantern commented May 28, 2024

@pasha-codefresh I would like to work on this issue, can you assign me an issue?

@pasha-codefresh
Copy link
Member

Thank you @Jack-R-lantern

@Jack-R-lantern
Copy link
Contributor

@tooptoop4
Is it better to implement logging on/off based on the reason for the event?
Or should we implement on/off based on the kind?

@tooptoop4
Copy link
Author

i was interested in turning off all

@michalrysavy-ext95730
Copy link

Hi, many different controllers aggregates theirs events with count / firstTimestamp / lastTimestamp. It could solve some problems with growing etcd, could't it?
I'm not realy sure how it it works, but is it possible for ArgoCD?

@Jack-R-lantern
Copy link
Contributor

@michalrysavy-ext95730
Optionally, you can control the events that argocd generates.
You can turn off events that you deem unnecessary in the course of your operations.

@pasha-codefresh pasha-codefresh added the component:audit Information that helps use to track application history (app events, proj event etc) label Sep 17, 2024
gdsoumya pushed a commit that referenced this issue Sep 23, 2024
* feat: option to disable writing k8s events

optioned to write logs for k8s events.
Each is passed as an environment variable and defaults to true,
disabling it requires explicitly setting the option to false.

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

* feat: option to disable writing k8s events

fix unit test
- application_test
- applicationset_test
- project_test
- appcontroller_tes
- audit_logger_test

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

* rebase

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

---------

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
ratulbasak pushed a commit to ratulbasak/argo-cd that referenced this issue Sep 25, 2024
…18441)

* feat: option to disable writing k8s events

optioned to write logs for k8s events.
Each is passed as an environment variable and defaults to true,
disabling it requires explicitly setting the option to false.

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

* feat: option to disable writing k8s events

fix unit test
- application_test
- applicationset_test
- project_test
- appcontroller_tes
- audit_logger_test

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

* rebase

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

---------

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
Signed-off-by: ratulbasak <ratulbasak93@gmail.com>
Jack-R-lantern added a commit to Jack-R-lantern/argo-cd that referenced this issue Nov 13, 2024
…18441)

* feat: option to disable writing k8s events

optioned to write logs for k8s events.
Each is passed as an environment variable and defaults to true,
disabling it requires explicitly setting the option to false.

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

* feat: option to disable writing k8s events

fix unit test
- application_test
- applicationset_test
- project_test
- appcontroller_tes
- audit_logger_test

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

* rebase

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

---------

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
gdsoumya pushed a commit that referenced this issue Nov 14, 2024
* feat: option to disable writing k8s events

optioned to write logs for k8s events.
Each is passed as an environment variable and defaults to true,
disabling it requires explicitly setting the option to false.

---------

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
adriananeci pushed a commit to adriananeci/argo-cd that referenced this issue Dec 4, 2024
…18441)

* feat: option to disable writing k8s events

optioned to write logs for k8s events.
Each is passed as an environment variable and defaults to true,
disabling it requires explicitly setting the option to false.

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

* feat: option to disable writing k8s events

fix unit test
- application_test
- applicationset_test
- project_test
- appcontroller_tes
- audit_logger_test

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

* rebase

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

---------

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
Signed-off-by: Adrian Aneci <aneci@adobe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:audit Information that helps use to track application history (app events, proj event etc) enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants