jimmidyson / configmap-reload

Simple binary to trigger a reload when a Kubernetes ConfigMap is updated
Apache License 2.0
969 stars 191 forks source link

Hostpath Mount not working #79

Open whitepiratebaku opened 1 year ago

whitepiratebaku commented 1 year ago

Hello, is it supposed to work with HostPath mount from node? because it does not seem to work.

jimmidyson commented 1 year ago

Hmm that's an interesting one. This will not work because the strategy expects the volume to be mounted in the way that a configmap (or secret) is mounted (see https://github.com/jimmidyson/configmap-reload/blob/main/configmap-reload.go#L183).

whitepiratebaku commented 1 year ago

Yeah, thank you

alitari commented 1 year ago

@jimmidyson ok, but what is the reason behind this restriction to "..data" ? Wouldn't it simply work with all kind of data sources ( persistent volumes , etc.) if we skip this restriction?

jimmidyson commented 1 year ago

Originally this was only for configmaps, which work with this ..data strategy, and I can't remember the reason why I enforced this restriction :sweat_smile:

jimmidyson commented 1 year ago

Thinking about this, the inotify notification required would be different for a hostpath volume or persistentvolume mount, in that what are we watching: the mounted directory, or content in the mounted directory? For configmaps, watching ..data only makes sense as the directory symlink is updated which makes what we're watching much easier. To have more generic support, we would need to think about what we do support and what the UX would be.

alitari commented 1 year ago

i understand, thx for the explanation :+1: