From fc81d92c88dd976600bf4c982e5aca342d8930b2 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Mon, 12 Mar 2018 10:40:04 +0100 Subject: [PATCH] Enhance Traefik TOML sample. --- examples/accessLog/traefik.ab.toml | 10 ++-- examples/accessLog/traefik.example.toml | 10 ++-- examples/acme/acme.toml | 9 ++-- examples/compose-rancher.yml | 2 +- examples/compose-traefik.yml | 2 +- examples/k8s/traefik-deployment.yaml | 2 +- examples/k8s/traefik-ds.yaml | 2 +- integration/fixtures/acme/acme_http01.toml | 4 +- .../fixtures/acme/acme_http01_web.toml | 4 +- integration/fixtures/acme/certificates.toml | 6 +-- traefik.sample.toml | 52 +++++++++++++++---- 11 files changed, 71 insertions(+), 32 deletions(-) diff --git a/examples/accessLog/traefik.ab.toml b/examples/accessLog/traefik.ab.toml index 23f8a0c05..7b0287c64 100644 --- a/examples/accessLog/traefik.ab.toml +++ b/examples/accessLog/traefik.ab.toml @@ -5,11 +5,15 @@ traefikLogsFile = "log/traefik.log" accessLogsFile = "log/access.log" logLevel = "DEBUG" +[entryPoints] + [entryPoints.api] + address = ":7888" + ################################################################ -# Web configuration backend +# API configuration ################################################################ -[web] -address = ":7888" +[api] +entryPoint = "api" ################################################################ # File configuration backend diff --git a/examples/accessLog/traefik.example.toml b/examples/accessLog/traefik.example.toml index ca3a44369..c56709f03 100644 --- a/examples/accessLog/traefik.example.toml +++ b/examples/accessLog/traefik.example.toml @@ -5,11 +5,15 @@ traefikLogsFile = "log/traefik.log" accessLogsFile = "log/access.log" logLevel = "DEBUG" +[entryPoints] + [entryPoints.api] + address = ":7888" + ################################################################ -# Web configuration backend +# API configuration ################################################################ -[web] -address = ":7888" +[api] +entryPoint = "api" ################################################################ # File configuration backend diff --git a/examples/acme/acme.toml b/examples/acme/acme.toml index 151ffb54c..831e51b67 100644 --- a/examples/acme/acme.toml +++ b/examples/acme/acme.toml @@ -11,7 +11,6 @@ defaultEntryPoints = ["http", "https"] address = ":443" [entryPoints.https.tls] - [acme] email = "test@traefik.io" storage = "/etc/traefik/conf/acme.json" @@ -19,12 +18,10 @@ entryPoint = "https" onDemand = false OnHostRule = true caServer = "http://traefik.localhost.com:4000/directory" -[acme.httpChallenge] -entryPoint="http" + [acme.httpChallenge] + entryPoint="http" - -[web] -address = ":8080" +[api] [docker] endpoint = "unix:///var/run/docker.sock" diff --git a/examples/compose-rancher.yml b/examples/compose-rancher.yml index 8eddcf589..06352a651 100644 --- a/examples/compose-rancher.yml +++ b/examples/compose-rancher.yml @@ -1,6 +1,6 @@ traefik: image: traefik - command: --web --rancher --rancher.domain=rancher.localhost --rancher.endpoint=http://example.com --rancher.accesskey=XXXXXXX --rancher.secretkey=YYYYYY --logLevel=DEBUG + command: --api --rancher --rancher.domain=rancher.localhost --rancher.endpoint=http://example.com --rancher.accesskey=XXXXXXX --rancher.secretkey=YYYYYY --logLevel=DEBUG ports: - "80:80" - "443:443" diff --git a/examples/compose-traefik.yml b/examples/compose-traefik.yml index ac468878f..e1b930ac1 100644 --- a/examples/compose-traefik.yml +++ b/examples/compose-traefik.yml @@ -1,6 +1,6 @@ traefik: image: traefik - command: -c /dev/null --web --docker --docker.domain=docker.localhost --logLevel=DEBUG + command: -c /dev/null --api --docker --docker.domain=docker.localhost --logLevel=DEBUG ports: - "80:80" - "8080:8080" diff --git a/examples/k8s/traefik-deployment.yaml b/examples/k8s/traefik-deployment.yaml index ab4a6b98a..23f81cbe2 100644 --- a/examples/k8s/traefik-deployment.yaml +++ b/examples/k8s/traefik-deployment.yaml @@ -29,7 +29,7 @@ spec: - image: traefik name: traefik-ingress-lb args: - - --web + - --api - --kubernetes --- kind: Service diff --git a/examples/k8s/traefik-ds.yaml b/examples/k8s/traefik-ds.yaml index b15a3fd7d..1836c95c8 100644 --- a/examples/k8s/traefik-ds.yaml +++ b/examples/k8s/traefik-ds.yaml @@ -35,7 +35,7 @@ spec: privileged: true args: - -d - - --web + - --api - --kubernetes --- kind: Service diff --git a/integration/fixtures/acme/acme_http01.toml b/integration/fixtures/acme/acme_http01.toml index 1e4f354fe..d85cc74a6 100644 --- a/integration/fixtures/acme/acme_http01.toml +++ b/integration/fixtures/acme/acme_http01.toml @@ -17,8 +17,8 @@ entryPoint = "https" onDemand = {{.OnDemand}} OnHostRule = {{.OnHostRule}} caServer = "http://{{.BoulderHost}}:4000/directory" -[acme.httpchallenge] -entrypoint="http" + [acme.httpchallenge] + entrypoint="http" [file] diff --git a/integration/fixtures/acme/acme_http01_web.toml b/integration/fixtures/acme/acme_http01_web.toml index 346af1e63..77d0b772c 100644 --- a/integration/fixtures/acme/acme_http01_web.toml +++ b/integration/fixtures/acme/acme_http01_web.toml @@ -20,8 +20,8 @@ entryPoint = "https" onDemand = {{.OnDemand}} OnHostRule = {{.OnHostRule}} caServer = "http://{{.BoulderHost}}:4000/directory" -[acme.httpchallenge] -entrypoint="http" + [acme.httpchallenge] + entrypoint="http" [file] diff --git a/integration/fixtures/acme/certificates.toml b/integration/fixtures/acme/certificates.toml index c0bdc831b..79d937723 100644 --- a/integration/fixtures/acme/certificates.toml +++ b/integration/fixtures/acme/certificates.toml @@ -11,6 +11,6 @@ [[tls]] entryPoints = ["https"] - [tls.certificate] - certFile = "fixtures/acme/ssl/wildcard.crt" - keyFile = "fixtures/acme/ssl/wildcard.key" \ No newline at end of file + [tls.certificate] + certFile = "fixtures/acme/ssl/wildcard.crt" + keyFile = "fixtures/acme/ssl/wildcard.key" \ No newline at end of file diff --git a/traefik.sample.toml b/traefik.sample.toml index 60eb3acd7..8385ccbc5 100644 --- a/traefik.sample.toml +++ b/traefik.sample.toml @@ -14,7 +14,7 @@ # Optional # Default: "ERROR" # -# logLevel = "ERROR" +# logLevel = "DEBUG" # Entrypoints to be used by frontends that do not specify any entrypoint. # Each frontend can specify its own entrypoints. @@ -24,6 +24,10 @@ # # defaultEntryPoints = ["http", "https"] +################################################################ +# Entrypoints configuration +################################################################ + # Entrypoints definition # # Optional @@ -32,6 +36,10 @@ [entryPoints.http] address = ":80" +################################################################ +# Traefik logs configuration +################################################################ + # Traefik logs # Enabled by default and log to stdout # @@ -54,6 +62,10 @@ # # format = "common" +################################################################ +# Access logs configuration +################################################################ + # Enable access logs # By default it will write to stdout and produce logs in the textual # Common Log Format (CLF), extended with additional fields. @@ -78,17 +90,39 @@ # format = "common" ################################################################ -# Web configuration backend +# API and dashboard configuration ################################################################ -# Enable web configuration backend -[web] +# Enable API and dashboard +[api] -# Web administration port -# -# Required -# -address = ":8080" + # Name of the related entry point + # + # Optional + # Default: "traefik" + # + # entryPoint = "traefik" + + # Enabled Dashboard + # + # Optional + # Default: true + # + # dashboard = false + +################################################################ +# Ping configuration +################################################################ + +# Enable ping +[ping] + + # Name of the related entry point + # + # Optional + # Default: "traefik" + # + # entryPoint = "traefik" ################################################################ # Docker configuration backend