This is a plugin for Traefik to FIXME.
To use this template, you should:
- Replace all
tmpl
by the name of your plugin:
find -type f -exec sed -i "s/tmpl/[my-plugin-name]/" {} \;
- Replace all
Tmpl
by the 'pretty' name of your plugin. - Fix all
FIXME
.
To publish your plugin, you should (see ref):
- Create a GitHub release.
- Make sure that the repository is public and have the
traefik-plugin
topic.
Here is an example of a file provider dynamic configuration (given here in
YAML), where the interesting part is the http.middlewares
section:
# Dynamic configuration
http:
routers:
my-tmpl-router:
rule: host(`tmpl.localhost`)
service: service-tmpl@file
middlewares:
- traefik-plugin-tmpl
middlewares:
traefik-plugin-tmpl:
plugin:
traefik-plugin-tmpl:
foo: "bar"
services:
service-tmpl:
loadBalancer:
servers:
- url: http://127.0.0.1:8000
There is a docker-compose.yml
file to test the plugin locally:
docker-compose up -d
Then, you can go to http://tmpl.localhost to see the result.