From ffb61694a57efc7e718be0d15a0e96a94fb15738 Mon Sep 17 00:00:00 2001 From: cr0hn Date: Sun, 25 Mar 2018 16:01:39 +0200 Subject: [PATCH] Update README.md - Added an small FAQ - Added usage examples - Added new label 'traefik.frontend.rule', more useful to add your own domains --- templates/traefik/20/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/templates/traefik/20/README.md b/templates/traefik/20/README.md index de5e2e8..1648ee8 100644 --- a/templates/traefik/20/README.md +++ b/templates/traefik/20/README.md @@ -70,6 +70,7 @@ Use this labels if you choose extenal rancher integration. - traefik.backend.loadbalancer.method = < drr | wrr > # Override default lb algorithm `drr` - traefik.backend.circuitbreaker.expression = < expression > # Override default backend circuitbreaker expression `NetworkErrorRatio() > 0.5` - traefik.frontend.passHostHeader = < true | false > # Forward client Host header to the backend. Default `true` +- traefik.frontend.rule = < rule > # Rule for host. Usually used to specify a host. I.e: 'Host:MySite.com' - traefik.weight = < weight > # Override default backend weight `5` - traefik.alias = < alias > # Alternate names to route rule. Multiple values separated by ",". traefik.domain is appended. WARNING: You could have collisions BE CAREFULL - traefik.alias.fqdn = < alias fqdn > # Alternate names to route rule. Multiple values separated by ",". traefik.domain must be defined but is not appended here. @@ -102,4 +103,24 @@ More info [rancher-traefik](https://github.com/rawmind0/rancher-traefik) Note: To access the services, you need to create A or CNAMES dns entries for every one. +### Usage examples + +#### Setup Traefik for a custom domain + +You must set these labels for the service your want to expose: +- traefik.port = 8080 +- traefik.acme = true +- traefik.frontend.rule = Host:MyCustoDomain.com +- traefik.enable = true + +### F.A.Q + +#### Q: Traefik doesn't expose my service + +Depending of de Traefik configuration we can diffenciate two cases: +- If you configured Traefik with label *rancher_healthcheck=true* -> ensure your service has a healthcheck +- If you configured Traefik without healthcheck, then check the Traefik log. Some times Traefik fails when try to load an invalid config and, before that, doesn't load new services -> restart Traefik should fix that + +### References + [traefik rancher backend]: https://docs.traefik.io/configuration/backends/rancher/#labels-overriding-default-behaviour