Skip to content

Suggestions on how to improve docs (no rules read from config file)? #887

@hartzell

Description

@hartzell

I'm new to trafik (and like it a lot, THANKS!).

I spent more time than I will happily admit trying to understand why the following configuration file didn't seem to do anything at all:

defaultEntryPoints = ["http"]

[entryPoints]
  [entryPoints.http]
  address = ":80"

[web]
address = ":8086"

[backends]
  [backends.backend1]
    [backends.backend1.servers.server1]
    url = "http://192.168.99.100:8080"

[frontends]
  [frontends.frontend1]
  backend = "backend1"
    [frontends.frontend1.routes.test_1]
    rule = "PathPrefix:/foo/bar/test-1"

It turns out that if you want traefik to read rules from the file that it's already happily reading, you must add a [file] line, even though it's already reading the file, e.g.

# ...
[file]
[backends]
  [backends.backend1]
    [backends.backend1.servers.server1]
# ...

I assumed (dangerous word, that...) that I only needed a [file] section if I wanted to read from some other file.

I'd like to add a couple of explanatory lines to the documentation, but am unsure what to suggest. My best idea is to add something after the first sentence of the file backend docs. It might also be useful to put it someplace more obvious.

There might also be a bug/enhancement here, that any {back,front}ends encountered while parsing the configuration file should be taken to be static configuration, obviating the need for the [file] line. I don't know the code structure well enough to say whether that's crazy talk or a reasonable idea.

It might also be an error to have a config file that doesn't define any {back,front}ends (which is what my starting point was doing...), but I may be missing something.

Feedback?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions