Traefik router

Traefik router is an Edge Router, it means that it’s the door to your platform, and that it intercepts and routes every incoming request: it knows all the logic and every rule that determine which services handle which requests (based on the path, the host, headers, and so on …).

The Door to Your Infrastructure

Auto Service Discovery

Where traditionally edge routers (or reverse proxies) need a configuration file that contains every possible route to your services, Traefik gets them from the services themselves.

Deploying your services, you attach information that tells Traefik the characteristics of the requests the services can handle.

Decentralized Configuration

It means that when a service is deployed, Traefik detects it immediately and updates the routing rules in real time. The opposite is true: when you remove a service from your infrastructure, the route will disappear accordingly.

You no longer need to create and synchronize configuration files cluttered with IP addresses or other rules.

How to install Traefik

Use the Official Docker Image

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

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

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.1.4
  • Docker images are based from the Alpine Linux Official image.
  • Any orchestrator using docker images can fetch the official Traefik docker image.

Use the Helm Chart

Warning

The Traefik Chart from Helm’s default charts repository is still using Traefik v1.7.

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

Ensure that the following requirements are met:

  • Kubernetes 1.14+
  • Helm version 3.x is installed

Add Traefik’s chart repository to Helm:

helm repo add traefik https://containous.github.io/traefik-helm-chart

You can update the chart repository by running:

helm repo update

And install it with the helm command line:

helm install traefik traefik/traefik

Helm Features

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

kubectl create ns traefik-v2
# Install in the namespace "traefik-v2"
helm install --namespace=traefik-v2 \
    traefik traefik/traefik

Installing with Custom Values

Use the Binary Distribution

Grab the latest binary from the releases page. Check the integrity of the downloaded file Extract the downloaded archive

And run it:

./traefik --help

Compile your Binary from the Sources

All the details are available in the Contributing Guide

Source

https://docs.traefik.io/