stakater / Reloader

A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig – [✩Star] if you're using it!
https://docs.stakater.com/reloader/
Apache License 2.0
7.45k stars 493 forks source link

Ability to blacklist/exclude some config resources from watched ones? #284

Open pidj opened 2 years ago

pidj commented 2 years ago

Hello,

I just discovered the Reloader project and it seems very interesting ! Including for my work :-)

I was wondering if a feature exists, as I have the impression it doesn't for now. The "configmap.reloader.stakater.com/reload" annotation allows a whitelisting mechanism (so to only watch a known-in-advance list of config resources). In our case, I would be very interested by the ability to have a blacklisting mechanism instead (used in combination with the "reloader.stakater.com/auto" annotation at least), so that any modified CM/Secret loaded by the Deployment would trigger a reload except for the explicitly listed CMs/Secrets to ignore.

Am I wrong or this functionality doesn't exist yet ? Would you consider developing such a list of "CMs/Secrets to ignore" ?

Thanks a lot ! Kind regards, Pierre

smuda commented 2 years ago

I'm not a maintainer, but my understanding is that if you don't want to use the "auto" method, you use reloader.stakater.com/search: "true" on the deployment and reloader.stakater.com/match: "true" on the configmap or secret you want to monitor.

pidj commented 2 years ago

Thanks for the answer :-) Actually, I do want to use the "auto" method, but combined with a blacklisting mechanism, i.e. not require to add annotations on all the existing CMs/Secrets (because we don't have the ownership on all those CMs/Secrets). Having to add the 'reloader.stakater.com/match: "true"' annotation corresponds to a whitelisting approach which I need to avoid. However, if there is a way to tell Reloader that "match=true" is the default value when no annotation was set on a config resource, and only ignore the config resources that explicitly have the "match=false" annotation, then it would be perfect and would solve my issue :-)

faizanahmad055 commented 1 year ago

At the moment, the functionality doesn't exist. But you are welcome to contribute via a PR :) .

Gruummy commented 10 months ago

It feels for me that we have here similarities with https://github.com/stakater/Reloader/issues/317