I was trying to follow the docs regarding automatic configuration reload and noticed an issue for which I am not sure if it's isolated case for me or not.
My setup is the following(Pretty much the quick start from docs):
dynamic.yml-file I tested with full copy paste from https://docs.traefik.io/reference/dynamic-configuration/file/ but also with random parts from that and verified that it did load them into dashboard just fine when I restarted the container.
My issue starts when I try to modify that dynamic configuration file and it should reload the configuration:
No matter if I modify the file locally outside the container or if I just echo text into the file while being inside container shell the configuration is never reloaded even though I have set the
watch setting to true unless I restart the container itself.
Am I doing something horribly wrong somewhere?
Docker Host OS: MacOS(10.14.4)
Docker version: 19.03.1
with Docker I recommend to mount a folder instead of a file, because have some issues with fs notify on mounted file.
I tried that but it has the exact same issue.
./config:/etc/traefik and confirmed that the configurations were loaded fine but no matter what I modified inside the container or outside on that dynamic file, it just didn't trigger the reload and i did also check the container logs and no mention of any reloads.
I can reproduce with filename but not with directory.
Could you give more information about your environment?
I decided to try again but this time removed the
filename and replaced it with
directory and it seems to reload the dynamic config now. I have no idea why filename doesn't work but seems like directory does the same thing which I need for the project I have.
This was the configuration that seems to work but gives no console line or anything that it was reloaded:
So it seems that with filename it refuses to reload anything even with watch enabled but if it just listens the directory it does works as I can see middleware being removed / altered each time I refresh the dashboard after I emptied or modified the dynamic file.
Would have preferred to only watch for that one dynamic file but I guess this works too.