Enabling the file provider in Traefik V2

Using Traefik version 2.0.0-beta1, I'm attempting to enable the file provider. According to the documentation, we can write dynamic configuration in the main Traefik configuration file:

You can write these configuration elements:

  • At the end of the main Traefik configuration file (by default: traefik.toml / traefik.yml / traefik.yaml ).

We also see examples of enabling the file provider specifying none of its optional fields:

providers:
  file: {}

When I try to do so in my main traefik.yaml file, Traefik fails immediately with the following message:

command traefik error: file cannot be a standalone element (type *file.Provider)

Is this an unintentional regression? Is the documentation wrong?

Hi @seh, the documentation to use is the online website at https://docs.traefik.io/v2.0.

In particular, you are interested in this page: https://docs.traefik.io/v2.0/providers/file/.

With the latest v2.0.0-beta1, you must separate the static configuration from the dynamic configuration.

For your configuration, it means that you must specify a providers.file.filename attribute (hence the error message you have that expects either a filename or directory attribute).

I agree with you on the documentation page not clear enough: would you be willing to improve it by contributing?

Thanks a lot!

Figuring out which documentation pages pertain to what's true in version 2 has been difficult. Which page do you think should mention this restriction?

Hey seh!

I guess on the page @dduportal mentioned.

Hello @seh, as the version v2.0 is still worked on, the documentation is absolutely not complete and is evolving step by step. But it is really a hard work.

Would you be interested in proposing a contribution, as it's Open Source, any help from the community is appreciated :slight_smile: