Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Yggdrasil/1f1a139ea1b2e55b834761cf987fb80a to your computer and use it in GitHub Desktop.
Save Yggdrasil/1f1a139ea1b2e55b834761cf987fb80a 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment