fluxcd / helm-controller

The GitOps Toolkit Helm reconciler, for declarative Helming
https://fluxcd.io
Apache License 2.0
409 stars 164 forks source link

Watch ConfigMaps/Secrets referenced in HelmReleases #1086

Open jan-kantert opened 4 weeks ago

jan-kantert commented 4 weeks ago

For performance (less dry-runs) and latency reasons (small queue and faster updates) it would be great if helm-operator would watch its referenced configmaps/secrets and trigger a reconcile on helmreleases. Basically the same as (closed) #143 or the (closed) #42. Any chance to get this eventually?

stefanprodan commented 4 weeks ago

This is not something that could be done for helm-controller only, if we're adding watchers for Secrets/ConfigMaps they should apply to all Flux controllers with custom resources that have refs, but I'm not considering dynamic watchers. Instead we could add watchers to all Flux controllers based on a predefined label that users should add to the Secrets/ConfigMaps e.g. toolkit.fluxcd.io/watch: enabled. In each controller we would create custom indexes based on the ref type/name/namespace similar to: https://github.com/fluxcd/helm-controller/blob/c8ae4b6ad225d37b19bacb634db784d6096908ac/internal/controller/helmrelease_controller.go#L116-L126