I expected the following command to override the providers.file.directory defined in traefik.yml, but it does not.
traefik \
--configFile=traefik/traefik.yml
--providers.file.directory="$(pwd)/traefik/dynamic"
I am running my config at least two different ways and the only thing that is different is the the to the dynamic directory - is there no way to override config file values from the command line?
No, that is not possible (doc):
The Static Configuration
There are three different, mutually exclusive (i.e. you can use only one at the same time), ways to define static configuration options in Traefik:
- In a configuration file
- In the command-line arguments
- As environment variables
These ways are evaluated in the order listed above.
Thank you.
In the config file, I have removed providers entirely, included providers but nothing else, included providers.files and nothing more, and providers.files.watch=true - and adjusted the cli options accordingly (so a complete providers set of properties was provided) and was not able to successfully have it watch a different directory - I may have made a mistake in that process so I will go through it again to make sure.
Is there some design decision I can read about why these are mutually exclusive?
I am surprised that cli options cannot override settings in the config file
When you have a traefik.yml
file, the only CLI option accepted is —configFile=
for a different file location.
If you want it differently, you could open a feature request with the devs on Traefik Github.