Traefik

A Scalable and Highly Available Edge Router

Traefik's Logo

How to use these slides?

  • Browse the slides: Use the arrows

    • Change chapter: Left/Right arrows

    • Next or previous slide: Top and bottom arrows

  • Overview of the slides: keyboard’s shortcut "o"

  • Speaker mode (and notes): keyboard’s shortcut "s"

Whoami

Emile vauge

emile bw

Containous

  • We Believe in Open Source

  • We Deliver Traefik

  • Commercial Support for Traefik

  • 20 people, 90% tech

Containous Logo

Why Traefik?

Why, Mr Anderson?

Why, Mr Anderson?

Evolution of Software Design

Evolution of Software Design

The Premise of Microservices…​

Asterix - Premise

…​and What Happens

Asterix - Fighting

Tools of the Trade

docker
rancher os
docker swarm
kubernetes
marathon
ec2
mesos
dynamodb
ecs
service fabric
consul
netflix oss
etcd
zookeeper

Where’s My Service?

Where os Charlie?
yaml

What If I Told You?

What If I Told You

That You Don’t Have to Write This Configuration File…​?

Here Comes Traefik!

Traefik's Logo

Overview

Traefik's Architecture

Traefik Project

Why Go?

  • Ecosystem (Docker, Kubernetes, Etcd, Consul…​)

  • Fast & "low level"

  • Fat binary

  • OSS friendly (Easy to learn/read)

I’ve Found A Bug!

./traefik bug

Autofills the issue template (environment, configuration files, …​)

Traefik Core Concepts

Bored Minion

Remember the Diagram?

Traefik's Architecture

Let’s Simplify

Traefik's Simplified Architecture

Providers

Traefik's Simplified Architecture

Entrypoints

Traefik's Entrypoints

Backends

Traefik's Backends

Frontends

Traefik's Frontends

At a Glance

Traefik Architecture At A Glance

In Practice

Traefik in Practise

A Glimpse on Traefik’s Features

Keep It Simple

Show me the code!

  • With Docker:

entrypoint:
    image: traefik:v1.7
    command:
      - "--docker"
      - "--docker.domain=mycompany.org"
      - "--acme.email=ssl-admin@mycompany.org"
      - "--acme.httpChallenge.entryPoint=http"
      # Or you could use a TOML file with "--configFile=/etc/traefik/traefik.toml
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

HTTPS for Everyone with Let’s Encrypt

Lets Encrypt HTTP Challenge
Lets Encrypt DNS Challenge

With Docker: Simple backend

# https://www.mycompany.org
webserver:
    image: nginx:alpine
    labels:
      - "traefik.frontend.rule=Host:www.mycompany.org"

With Docker: Websockets

# https://mycompany.org/webterminal
webterminal:
    image: tsl0922/ttyd
    labels:
      - "traefik.frontend.rule=PathPrefixStrip:/webterminal"
    expose:
      - "7681"

With Docker: Context

# http://mycompany.org/jenkins
jenkins:
    image: jenkins/jenkins:lts
    labels:
      - "traefik.frontend.rule=PathPrefix:/jenkins"
      - "traefik.port=8080" # Because 50000 is also exposed
    environment:
      - JENKINS_OPTS=--prefix=/jenkins

With Docker: Rewrites

# http://mycompany.org/gitserver
gitserver:
    image: gitea/gitea:1.5
    labels:
      - "traefik.frontend.rule=PathPrefixStrip:/gitserver"
      - "traefik.port=3000" # Because 22 is also exposed

Traefik with Kubernetes

Traefik with Kubernetes Diagram

With Kubernetes Too!

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    # kubernetes.io/ingress.class: 'nginx'
    kubernetes.io/ingress.class: 'traefik'
spec:
  rules:
  - host: mycompany.org
    http:
      paths:
      - path: "/whoami"
        backend:
          serviceName: whoami
          servicePort: 80

We Missed Talking About …​

word cloud

Demo

Demo
TraefikEE

Did you Say "High Availability"?

A Highly-Available Traefik

verysecretproject high availability

A Safe Traefik

verysecretproject safety

A Scalable Traefik

verysecretproject scalability

As Simple As Traefik

$ traefikeectl install \
  --licensekey="j1fIw4wmYHsnuTM6VUmiHAKnVzLtaQHX" \
  --dashboard \
  --kubernetes

Early Access

Let’s Talk About The Future

Revamped Documentation

background

Clarified Concepts

traefik v2 concepts

Expressive Routing Rule Syntax

traefik v2 rules

# Send both requests to backend service:
#   https://api.mycompany.com/v2
#   https://api-v2.mycompany.com

rule=(Host('api.mycompany.com') && PathPrefix('/v2')) || Host('api-v2.mycompany.com')

Middlewares

traefik v2 middlewares

Custom Resources Definition

kubernetes
traefik v2 tcp

Demo

demo4 v2 tcp http

More to come

  • New WebUI

  • Newmetrics

  • UDP

  • YAML

  • TLS stores & options

  • Canary

More info

We have

stickers!

We are hiring!

Containous
docker run -it containous/jobs

Thank you!

QRCode to this presentation