Comment on Traefik and external services
IHawkMike@lemmy.world 4 months ago
I use the Traefik file provider for this.
doc.traefik.io/traefik/providers/file/
It picks up all my .yml configs in the watched folder which define the routers and services external to Docker.
Hellmo_Luciferrari@lemm.ee 4 months ago
Would the file provider configs live on the Traefik server, or would they need to be on the external service. Reading through this, and looking at the example configuration files doesn’t really seem to point that out. Sorry for the noob questions.
Trying to understand this, but the way the documentation is written is different than I am used to.
Thank you!
IHawkMike@lemmy.world 4 months ago
No worries for the question. It’s not terribly intuitive.
The configs live on the Traefik server. In my static traefik.yml config I have the following providers section, which adds the
file
provider in addition to thedocker
provider which you likely already have:And in the /config folder mapped into the Traefik container I have several files for services external to docker. You can combine them or keep them separate since the
watch: true
setting tells it to read in all files (and it’s near instant when you create them, no need to restart Traefik).Here is my homeassistant.yml in that folder (I have a separate VM running HASS outside of Docker/Traefik):
Hope this helps!
Hellmo_Luciferrari@lemm.ee 4 months ago
so in my traefik.yml file I have cloudflare set as my certresolver as follows:
And I had to get the secret mounted via the docker-compose file.
So where you have:
tls:
Do I have to redefine all of the same information I did in my Traefik yml but in this separate config.yml?
(I did set it up in my traefik.yml and docker-compose.yml to mount and use this config, which I had commented out for later use.
Thank you so much for the help!
IHawkMike@lemmy.world 4 months ago
I think you’re close.
You need to change
service: pihole-rtr
toservice: pihole-svc
.No, you just need to reference it like you have. Define once, reference many.