Migrate Traefik Configuration To Environment Variables #813
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently overriding / extending the
traefik.yml
configuration is difficult. This PR proposes migrating the Traefik configuration from the.yml
file to environment variables. This should improve both the extendability and maintainability of attempting to extend the Traefik config. Such as, but not limited to configuring plugins or certificate resolvers.I've found there are 2 main pain points to the current approach.
svc up
command replaces any modifications under$HOME/.warden/etc/traefik/traefik.yml
See HereNote: May be considered a breaking change. Since any custom changes to the
traefik.yml
by users would have to be reimplemented via the ENV approach. Due to Traefik static config approaches being mutually exclusive.Example Use Case
Say you want to enable debug logging for Traefik. With the environment variable approach you can create a docker compose file in the warden home directory with the following contents.
Or if you want to define a certificate resolver such as LetsEncrypt to sign your certs. It can again be defined in the users home directory with the following docker compose file. See this issue of someone attempting a similar thing and having to override the source file