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)

Most upvoted comments

Thanks for your help @kingdonb in debugging and finding a solution!

I believe the mystery is solved, tl;dr: there is a Health check passed message with reason: Progressing that gets sent at the appropriate time, filtering for that string in the inclusionList works, and ReconciliationSucceeded alert can be ignored.

(The health checks are only performed if healthChecks or wait: true are 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

apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Provider
metadata:
  name: test-webhook
  namespace: shail-notification-test
spec:
  type: generic
  address: http://172.24.207.81:5000/flux-webhook-test

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 lastTransitionTime to change, creating a new resourceVersion - 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:

The kustomize-controller marks a Kustomization as reconciling when it starts the reconciliation of the same.

doesn’t go into detail about it, but it does seem to be expected behavior.

an earlier version:

Every time the controller starts reconciling a Kustomization, it adds the Reconciling condition in status and updates its message to report the action performed during a reconciliation run

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!