diff --git a/docs/content/getting-started/install-traefik.md b/docs/content/getting-started/install-traefik.md index 15aa3733a5260ec4963e29a753fb0558febc0e7d..dfc592b81743b509c36be6fdff39d8993fb62246 100644 --- a/docs/content/getting-started/install-traefik.md +++ b/docs/content/getting-started/install-traefik.md @@ -44,10 +44,10 @@ Traefik can be installed in Kubernetes using the Helm chart from <https://github Ensure that the following requirements are met: -* Kubernetes 1.14+ -* Helm version 3.x is [installed](https://helm.sh/docs/intro/install/) +* Kubernetes 1.16+ +* Helm version 3.9+ is [installed](https://helm.sh/docs/intro/install/) -Add Traefik's chart repository to Helm: +Add Traefik Labs chart repository to Helm: ```bash helm repo add traefik https://traefik.github.io/charts @@ -68,6 +68,9 @@ helm install traefik traefik/traefik !!! tip "Helm Features" All [Helm features](https://helm.sh/docs/intro/using_helm/) are supported. + + Examples are provided [here](https://github.com/traefik/traefik-helm-chart/blob/master/EXAMPLES.md). + For instance, installing the chart in a dedicated namespace: ```bash tab="Install in a Dedicated Namespace" @@ -83,8 +86,7 @@ helm install traefik traefik/traefik as with [any helm chart](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). {: #helm-custom-values } - The values are not (yet) documented, but are self-explanatory: - you can look at the [default `values.yaml`](https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml) file to explore possibilities. + All parameters are documented in the default [`values.yaml`](https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml). You can also set Traefik command line flags using `additionalArguments`. Example of installation with logging set to `DEBUG`: diff --git a/docs/content/getting-started/quick-start.md b/docs/content/getting-started/quick-start.md index 5bddfc2aeeb87d36b9ca5aee431f689f98d2e068..6a411666efb16025ea436f7980f0dc9f31d9cf98 100644 --- a/docs/content/getting-started/quick-start.md +++ b/docs/content/getting-started/quick-start.md @@ -50,7 +50,12 @@ Now that we have a Traefik instance up and running, we will deploy new services. Edit your `docker-compose.yml` file and add the following at the end of your file. ```yaml -# ... +version: '3' + +services: + + ... + whoami: # A container that exposes an API to show its IP address image: traefik/whoami diff --git a/docs/content/traefik-hub/index.md b/docs/content/traefik-hub/index.md index f1c46035d227ae5cb64590676e7f9d3111b84d84..a6c57cee999a08e0dc25d9f527697865e96f576a 100644 --- a/docs/content/traefik-hub/index.md +++ b/docs/content/traefik-hub/index.md @@ -29,6 +29,12 @@ This agent can: * The Traefik Hub Agent must be installed to connect to the Traefik Hub platform. * Activate this feature in the experimental section of the static configuration. +!!! information "Configuration Discovery" + + According to installation options, the Traefik Hub Agent listens to the Docker or Kubernetes API to discover containers/services. + + It doesn't support the routers discovered by Traefik Proxy using other providers, e.g., using the File provider. + !!! example "Minimal Static Configuration to Activate Traefik Hub for Docker" ```yaml tab="File (YAML)" diff --git a/docs/content/user-guides/docker-compose/basic-example/index.md b/docs/content/user-guides/docker-compose/basic-example/index.md index 643df4505418322b5ace96aece4b36af4cdbe8e0..bda9ccca658a3ddb52ba46490a86e2cf6272b17d 100644 --- a/docs/content/user-guides/docker-compose/basic-example/index.md +++ b/docs/content/user-guides/docker-compose/basic-example/index.md @@ -16,6 +16,35 @@ This will also be used as a starting point for the other docker-compose guides. --8<-- "content/user-guides/docker-compose/basic-example/docker-compose.yml" ``` +??? Networking + + The Traefik container has to be attached to the same network as the containers to be exposed. + If no networks are specified in the docker-compose file, Docker creates a default one that allows Traefik to reach the containers defined in the same file. + You can [customize the network](https://docs.docker.com/compose/networking/#specify-custom-networks) as described in the example below. + You can use a [pre-existing network](https://docs.docker.com/compose/networking/#use-a-pre-existing-network) too. + + ```yaml + version: "3.3" + + networks: + traefiknet: {} + + services: + + traefik: + image: "traefik:v2.9" + ... + networks: + - traefiknet + + whoami: + image: "traefik/whoami" + ... + networks: + - traefiknet + + ``` + - Replace `whoami.localhost` by your **own domain** within the `traefik.http.routers.whoami.rule` label of the `whoami` service. - Run `docker-compose up -d` within the folder where you created the previous file. - Wait a bit and visit `http://your_own_domain` to confirm everything went fine. diff --git a/integration/fixtures/simple_debug_log.toml b/integration/fixtures/simple_debug_log.toml new file mode 100644 index 0000000000000000000000000000000000000000..5f6419a521101dbb4c2b56e82e075e0d954b590d --- /dev/null +++ b/integration/fixtures/simple_debug_log.toml @@ -0,0 +1,15 @@ +[global] + checkNewVersion = false + sendAnonymousUsage = false + +[log] + level = "DEBUG" + +[api] + insecure = true + +[providers.docker] + +[entryPoints] + [entryPoints.webHost] + address = ":8000" diff --git a/integration/simple_test.go b/integration/simple_test.go index 22327142fa9bf73580240f8c002a65e98bd382c6..41751d6a6fba100fd2cac32c1b18584a182cd08f 100644 --- a/integration/simple_test.go +++ b/integration/simple_test.go @@ -11,6 +11,7 @@ import ( "net/http" "net/http/httptest" "os" + "regexp" "strings" "sync/atomic" "syscall" @@ -1365,3 +1366,36 @@ func (s *SimpleSuite) TestMuxer(c *check.C) { } } } + +func (s *SimpleSuite) TestDebugLog(c *check.C) { + s.createComposeProject(c, "base") + + s.composeUp(c) + defer s.composeDown(c) + + file := s.adaptFile(c, "fixtures/simple_debug_log.toml", struct{}{}) + defer os.Remove(file) + + cmd, output := s.cmdTraefik(withConfigFile(file)) + + err := cmd.Start() + c.Assert(err, checker.IsNil) + defer s.killCmd(cmd) + + err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix(`/whoami`)")) + c.Assert(err, checker.IsNil) + + req, err := http.NewRequest(http.MethodGet, "http://localhost:8000/whoami", http.NoBody) + c.Assert(err, checker.IsNil) + req.Header.Set("Autorization", "Bearer ThisIsABearerToken") + + response, err := http.DefaultClient.Do(req) + c.Assert(err, checker.IsNil) + c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + + if regexp.MustCompile("ThisIsABearerToken").MatchReader(output) { + c.Logf("Traefik Logs: %s", output.String()) + c.Log("Found Authorization Header in Traefik DEBUG logs") + c.Fail() + } +}