This image is the traefik dynamic conf for rancher. It comes from rawmind/rancher-tools.
docker build -t rawmind/rancher-traefik:<version> .
This image has to be run as a sidekick of rawmind/alpine-traefik, and makes available /opt/tools volume. It scans from rancher-metadata, looking for services and externalServices that has traefik labels, and generates traefik frontend and backends to expose the services.
Traefik labels, has to be created in your service or externalService, in order to get included in traefik dynamic config.
- traefik.enable = < true | stack | false > #Controls if you want to publish or not the service
- true: the service will be published as service_name.stack_name.traefik_domain
- stack: the service will be published as stack_name.domain. WARNING: You can have collisions inside services within your stack
- false: the service will not be published
- traefik.priority = <priority> # Override for frontend priority. Default
- traefik.protocol = < http | https > # Override the default protocol
- traefik.sticky = < true | false > # Enable/disable sticky sessions to the backend. Default
- traefik.backend.loadbalancer.method = < drr | wrr > # Override default lb algorithm
- 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
- traefik.weight = < weight > # Override default backend weight
- 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.
- traefik.domain = < domain.name > # Domain names to route rules. Multiple domains separated by ","
- traefik.domain.regexp = < domain.regexp > # Domain name regexp rule. Multiple domains separated by ","
- traefik.port = <port> # port to expose throught traefik. Default
- traefik.acme = < true | false > # Enable/disable ACME traefik feature. Default
- traefik.path = < path > # Path rule. Multiple values separated by ","
- traefik.path.strip = < path > # Path strip rule. Multiple values separated by ","
- traefik.path.prefix = < path > # Path prefix rule. Multiple values separated by ","
- traefik.path.prefix.strip = < path > # Path prefix strip rule. Multiple values separated by ","
- traefik.ratelimit.enable = < true | false > # Enable/disabe rate-limiting based on client ip. Default
- traefik.ratelimit.period = < n > # Replace n with desired amount of seconds in which traefik is checking the limits "average" and "burst". Default
- traefik.ratelimit.average = < n > # Change to desired average allowed requests by client ip. Default
- traefik.ratelimit.burst = < n > # State what limit the client ip is allowed to burst up to respectively. Default
WARNING: Only services with healthy state are added to traefik, so health checks are mandatory.
Details for configuring the traefik rules can be found at: https://docs.traefik.io/basics/#frontends