Consul catalog backend
Træfɪk can be configured to use service discovery catalog of Consul as a backend configuration:
################################################################
# Consul Catalog configuration backend
################################################################
# Enable Consul Catalog configuration backend
#
# Optional
#
[consulCatalog]
# Consul server endpoint
#
# Required
#
endpoint = "127.0.0.1:8500"
# Default domain used.
#
# Optional
#
domain = "consul.localhost"
# Prefix for Consul catalog tags
#
# Optional
#
prefix = "traefik"
This backend will create routes matching on hostname based on the service name used in consul.
Additional settings can be defined using Consul Catalog tags:
traefik.enable=false
: disable this container in Træfɪktraefik.protocol=https
: override the defaulthttp
protocoltraefik.backend.weight=10
: assign this weight to the containertraefik.backend.circuitbreaker=NetworkErrorRatio() > 0.5
traefik.backend.loadbalancer=drr
: override the default load balancing modetraefik.backend.maxconn.amount=10
: set a maximum number of connections to the backend. Must be used in conjunction with the below label to take effect.traefik.backend.maxconn.extractorfunc=client.ip
: set the function to be used against the request to determine what to limit maximum connections to the backend by. Must be used in conjunction with the above label to take effect.traefik.frontend.rule=Host:test.traefik.io
: override the default frontend rule (Default:Host:{containerName}.{domain}
).traefik.frontend.passHostHeader=true
: forward clientHost
header to the backend.traefik.frontend.priority=10
: override default frontend prioritytraefik.frontend.entryPoints=http,https
: assign this frontend to entry pointshttp
andhttps
. OverridesdefaultEntryPoints
.