Install Traefik

You can install Traefik with the following flavors:

Use the Official Docker Image

Choose one of the official Docker images and run it with the sample configuration file:

  1. docker run -d -p 8080:8080 -p 80:80 \
  2. -v $PWD/traefik.toml:/etc/traefik/traefik.toml traefik:v2.0

For more details, go to the Docker provider documentation

Tip

  • Prefer a fixed version than the latest that could be an unexpected version.ex: traefik:v2.0.0
  • Docker images are based from the Alpine Linux Official image.
  • All the orchestrator using docker images could fetch the official Traefik docker image.

Use the Helm Chart

Experimental Helm Chart

Please note that the Helm Chart for Traefik v2 is still experimental.

The Traefik Stable Chart fromHelm's default charts repository is still using Traefik v1.7.

Traefik can be installed in Kubernetes using the v2.0 Helm chart from https://github.com/containous/traefik-helm-chart.

Ensure that the following requirements are met:

  • Kubernetes 1.14+
  • Helm version 2.x is installed and initialized with Tiller

Retrieve the latest chart version from the repository:

  1. # Retrieve Chart from the repository
  2. git clone https://github.com/containous/traefik-helm-chart

And install it with the helm command line:

  1. helm install ./traefik-helm-chart

Helm Features

All Helm features are supported.For instance, installing the chart in a dedicated namespace:

  1. # Install in the namespace "traefik-v2"
  2. helm install --namespace=traefik-v2 \
  3. ./traefik-helm-chart

Installing with Custom Values

You can customize the installation by specifying custom values,as with any helm chart.

The values are not (yet) documented, but are self-explanatory:you can look at the default values.yaml file to explore possibilities.

Example of installation with logging set to DEBUG:

  1. helm install --namespace=traefik-v2 \
  2. --set="logs.loglevel=DEBUG" \
  3. ./traefik-helm-chart

  1. # File custom-values.yml
  2. ## Install with "helm install --values=./custom-values.yml ./traefik-helm-chart
  3. logs:
  4. loglevel: DEBUG

Use the Binary Distribution

Grab the latest binary from the releases page.

Check the integrity of the downloaded file

  1. # Compare this value to the one found in traefik-${traefik_version}_checksums.txt
  2. sha256sum ./traefik_${traefik_version}_linux_${arch}.tar.gz

  1. # Compare this value to the one found in traefik-${traefik_version}_checksums.txt
  2. shasum -a256 ./traefik_${traefik_version}_darwin_amd64.tar.gz

  1. # Compare this value to the one found in traefik-${traefik_version}_checksums.txt
  2. Get-FileHash ./traefik_${traefik_version}_windows_${arch}.zip -Algorithm SHA256

Extract the downloaded archive

  1. tar -zxvf traefik_${traefik_version}_linux_${arch}.tar.gz

  1. tar -zxvf ./traefik_${traefik_version}_darwin_amd64.tar.gz

  1. Expand-Archive traefik_${traefik_version}_windows_${arch}.zip

And run it:

  1. ./traefik --help

Compile your Binary from the Sources

All the details are available in the Contributing Guide