kustomize-controller: Duplicate ReconciliationSucceeded events produced by kustomization controller despite no changes
It appears that the kustomziation controller is creating an event for each ReconciliationSucceeded triggered by the interval despite no changes reported by the kustomization controller itself.
As a result, the notification controller is picking up each event and sending it out which is causing some spam.
Some observations:
From a kubectl describe kustomization/<my_kustomization> -n <my_namespace>
Normal ReconciliationSucceeded 59s (x72 over 20h) kustomize-controller (combined from similar events): Reconciliation finished in 116.431048ms, next run in 5m0s
The Status.Conditions. Last Transition Time also updates with each reconcillation
I also see the Metadata.Resource Version increment even though the generation and uid for the kustomization stays the same .
However during this time, the kustomziation controller’s logs is reporting {"level":"info","ts":"2024-11-05T16:59:40.336Z","msg":"server-side apply completed" .. with no changes
Manually doing a flux reconcile kustomization <my_kustomization> -n <my_namespace> causes an event as well even though there are no changes or diff detected by flux.
Tested on flux version 2.3.0
additional context in a slack conversation here: https://cloud-native.slack.com/archives/CLAJ40HV3/p1730772392863339
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (9 by maintainers)
Thanks for your help @kingdonb in debugging and finding a solution!
I believe the mystery is solved, tl;dr: there is a
Health check passedmessage withreason: Progressingthat gets sent at the appropriate time, filtering for that string in the inclusionList works, andReconciliationSucceededalert can be ignored.(The health checks are only performed if
healthChecksorwait: trueare set, and the alert event is only emitted when a change is detected in dry-run; otherwise there is no way to know when the kustomization’s applied resources are ready.)@kingdonb I’m using the generic webhook provider
I found an earlier report of this issue in the Notification controller repo:
It mentions the generic webhook provider (which I see you are using, going back through our slack thread)
I reviewed the details with @shailpatels in the slack thread, I have not gone to the length of configuring my alerts yet to verify the issue from end to end, but I see similar behavior in my minimal test configuration.
I’m using flux-operator, (I don’t think that has anything to do with the report) and Flux 2.4.0
It doesn’t make sense to me that a dry run with no changes triggers the
lastTransitionTimeto change, creating a newresourceVersion- maybe this is intended behavior, but I don’t think so, my expectation is there shouldn’t be any alerts (events) emitted until the Kustomization is changing something.The Kustomization API:
doesn’t go into detail about it, but it does seem to be expected behavior.
an earlier version:
I don’t think this aligns with our expectations about how alerts should work though, so I asked @shailpatels to file this as an issue - I’m going to bring this up at the dev meeting so we can try to get consensus about whether it is a bug or not.
Thanks for the report!