Traefik v2.0 & Maesh: Look Ma’, routing HTTP and TCP with no Hands!

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
30 people distributed, 90% tech


Why, Mr Anderson?




















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

MIT License
Written in Go
24,000+ ⭐ 1B+ ⬇️ 400+ 👷
Created in 2015, 4Y 🎂
Current stable branch: v2.0
Revamped Documentation
Clarified Concepts
Expressive Routing Rule Syntax
Middlewares
TCP Support
Canary / Mirroring
And so Much More…











version: '3'
services:
reverse-proxy:
image: traefik:v2.0
command: --providers.docker.endpoint="tcp://proxy-docker.svc.local:2376"
ports:
- "80:80"
corporate-webapp:
image: company/corporate-webapp:1.2.3
labels:
- "traefik.http.routers.webapp.rule=Host(`company.com`)"
admin-webapp:
image: company/admin-webapp:15.2.2
labels:
- "traefik.http.routers.admin-webapp.rule=Host(`company.com`) && PathPrefix(`/admin`)"
- "traefik.http.routers.admin-webapp.service=admin-svc"
- "traefik.http.services.admin-svc.LoadBalancer.server.Port=9999"
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: corporate-webapp
annotations:
kubernetes.io/ingress.class: 'traefik'
spec:
rules:
- host: localhost
http:
paths:
- backend:
serviceName: corporate-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 ingressrouteapiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: ingressroutetcpmongo.crd
spec:
entryPoints:
- mongotcp
routes:
- match: HostSNI(`mongo-prod`)
services:
- name: mongo-prod
port: 27017
Install Traefik v2 in Kubernetes cluster
Deploy and expose an HTTP application
Deploy and expose a TCP application
🛠 Custom Resource Definitions
👮 Configure RBAC
To allow watching the Kubernetes API
📦 Install Traefik as a Deployment
🚪 Expose and 📣 publish Traefik with the right Service type
LoadBalancer, NodePort?
✅ Configure Traefik and its features
📦 Install the web application as a Deployment
🚪 Expose the web application with a Service of type ClusterIP
Internal access only
📣 Publish the web application with an IngressRoute
Example with MongoDB:
📦 Install MongoDB as a Deployment
🚪 Expose MongoDB with a Service of type ClusterIP
Internal access only
📣 Publish MongoDB with an IngressRouteTCP
New Helm Chart for v2.0
Advanced Load-Balancing with CRDs: Canary, Mirroring, StickySession, etc.
Available today with File and Docker providers
Example and Guides
UDP?



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
...
Maesh is a lightweight, easy to configure, and non-invasive service mesh that allows visibility and management of the traffic flows inside any Kubernetes cluster.


Built on top of Traefik,
SMI (Service Mesh Interface specification) compliant,
Opt-in by default.
Install Maesh (Helm Chart):
helm repo add maesh https://containous.github.io/maesh/charts
helm repo update
helm install --name=maesh --namespace=maesh maesh/maesh --values=./maesh/values.yamlDeploy Applications:
kubectl apply -f apps/0-namespace.yaml
kubectl apply -f apps/1-svc-accounts.yaml
kubectl apply -f apps/2-apps-client.yaml
kubectl apply -f apps/3-apps-servers.yaml
kubectl apply -f apps/4-ingressroutes.yamlDeploy SMI Objects to allow traffic in the mesh:
kubectl apply -f apps/5-smi-http-route-groups.yaml
kubectl apply -f apps/6-smi-traffic-targets.yamlapiVersion: specs.smi-spec.io/v1alpha1
kind: HTTPRouteGroup
metadata:
name: app-routes
namespace: apps
matches:
- name: all
pathRegex: "/"
methods: ["*"]
---
apiVersion: access.smi-spec.io/v1alpha1
kind: TrafficTarget
metadata:
name: client-apps
namespace: apps
destination:
kind: ServiceAccount
name: apps-server
namespace: apps
specs:
- kind: HTTPRouteGroup
name: app-routes
matches:
- all
sources:
- kind: ServiceAccount
name: apps-client
namespace: appsstickers!

docker run -it containous/jobs