Edge Routing et HTTPS pour tous: Traefik en pratique (π«π·)
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"
Damien DUPORTAL:
TrΓ¦fik's Developer π₯ Advocate @ Containous
We Believe in Open Source
We Deliver Traefik and Traefik Enterprise Edition
Commercial Support
20 people, 90% tech
Why, Mr Anderson?
That You Don’t Have to Write This Configuration File…?
MIT License
Written in Go
22,000+ β 750M+ β¬οΈ 350+ π·
Created in 2015
Current stable branch: v1.7
Revamped Documentation
Clarified Concepts
Expressive Routing Rule Syntax
Middlewares
TCP Support
TLS stores & options
And so Much More…
With Docker Compose:
version: '3'
services:
reverse-proxy:
image: traefik:v2.0
command: --providers.docker
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
webapp:
image: containous/whoami
labels:
- "traefik.http.routers.webapp.rule=Host(`localhost`)"
# https://mycompany.org/jenkins -> http://jenkins:8080/jenkins
jenkins:
image: jenkins/jenkins:lts
environment:
- JENKINS_OPTS=--prefix=/jenkins
labels:
- "traefik.http.services.jenkins.LoadBalancer.server.Port=8080" # Because 50000 is also exposed
- "traefik.http.routers.jenkins.rule=Host(`mycompany.org`) && PathPrefix(`/jenkins`)"
- "traefik.http.routers.jenkins.service=jenkins"
# https://mycompany.org/gitserver -> http://gitserver:3000/
gitserver:
image: gitea/gitea
labels:
- "traefik.http.routers.gitserver.rule=Host(`mycompany.org`) && PathPrefix(`/gitserver`)"
- "traefik.http.middlewares.gitserver-stripprefix.stripprefix.prefixes=/gitserver"
- "traefik.http.routers.gitserver.middlewares=gitserver-stripprefix"
# https://mycompany.org/webterminal -> http://webterminal/
webterminal:
image: tsl0922/ttyd
labels:
- "traefik.http.routers.devbox.rule=Host(`mycompany.org`) && PathPrefix(`/webterminal`)"
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: 'traefik'
spec:
rules:
- host: localhost
http:
paths:
- path: "/whoami"
backend:
serviceName: webapp
servicePort: 80
# File "webapp.yaml"
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: simpleingressroute
spec:
entryPoints:
- web
routes:
- match: Host(`localhost`) && PathPrefix(`/whoami`)
kind: Rule
services:
- name: webapp
port: 80
$ kubectl apply -f webapp.yaml
$ kubectl get ingressroute
π₯ (Merged this week)
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: ingressroutetcpmongo.crd
spec:
entryPoints:
- mongotcp
routes:
- match: HostSNI(`mongo-prod`)
services:
- name: mongo-prod
port: 27017
New WebUI
New metrics
UDP
YAML
Canary
Install it:
# Cluster Installation
traefikeectl install \
--licensekey="SuperSecretLicence" \
--dashboard \
--kubernetes # Or --swarm
Configure it:
# Routing Configuration, same as Traefik's
traefikeectl deploy \
--acme.email=ssl-admin@mycompany.org
--acme.tlsChallenge
...
stickers!
docker run -it containous/jobs