Skip to content

Instantly share code, notes, and snippets.

@richardprice
Last active June 13, 2018 13:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save richardprice/0ccde40b0df06191228e5bde7558e1e3 to your computer and use it in GitHub Desktop.
Save richardprice/0ccde40b0df06191228e5bde7558e1e3 to your computer and use it in GitHub Desktop.
1. Create the KV config:
docker run traefik \
storeconfig \
--consul \
--consul.prefix="traefik" \
--consul.watch \
--consul.endpoint="CONSUL_IP:8500" \
--consulcatalog=true \
--consulcatalog.endpoint="CONSUL_IP:8500" \
--consulcatalog.constraints="tag==public" \
--logLevel=DEBUG \
--entryPoints='Name:https Address::443 TLS' \
--entryPoints='Name:http Address::80' \
--acme.entrypoint=https \
--acme=true \
--acme.domains="DOMAIN" \
--acme.ondemand=true \
--acme.onhostrule=true \
--acme.email="EMAIL" \
--acme.storage="traefik/acme/account" \
--web \
--web.address=":8089"
2. Log into consul UI and remove the /traefik/acme/accounts/storageFile key - if this exists, Traefik will exit with an error about "Error creating TLS config Empty Store, please provide a key for certs storage" (see https://github.com/containous/traefik/issues/927)
3. Start Traefik using the consul backend:
docker run --name ingress-lb \
-p 80:80 -p 443:443 -p 8089:8089 \
-d \
traefik \
--consul \
--consul.prefix="traefik" \
--consul.watch \
--consul.endpoint="CONSUL_IP:8500"
@holms
Copy link

holms commented Jun 13, 2018

can you show please you consul configuration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment