Dynamic Configuration File is not watched as expected in K8s

I've tried to use k8s with a dynamic file and I set watch = true in file provider, Then I added this configuration in a ConfigMap in k8s and I mounted it as a volume in my k8s deployment file.
But when I change and apply this new dynamic configuration, the changes aren't applied and I have to rollout my deployment again for it to reload its configuration.

Is there something I'm missing for this? Because I tried CRD and after each change, traefik watches it.
I also tried and build traefik locally and tested it dynamic file but again, I should break and start traefik again in order for it to load new configuration.



The reason you are seeing this behavior is due to the fact that k8s handles mounted configmaps as symlinks in the container's filesystem.

When a configmap is updated, a new source file is created, and the symlink is updated to point to the new file. This is why no inotify events are triggered.

I have a PR here: https://github.com/containous/traefik/pull/5037 that provides some links and explanations as to what is going on.

Hope this helps