SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
TRAEFIK AS AN OPEN SOURCE EDGE ROUTER
FOR MICROSERVICE ARCHITECTURES
JAKUB HAJEK
FEB 27TH, 2020
▸ I am the owner and technical consultant working for Cometari
▸ I’ve been system admin since 1998
▸ Cometari is a solutions company implementing DevOps culture
and providing consultancy, workshops and software services.
▸ Our expertise are DevOps, Elastic Stack - log analysis,
▸ We are deeply involved in the travel tech industry
▸ However our solutions go much further than just integrating
travel API’s.
INTRODUCTION
“I strongly believe that implementing DevOps culture, across
the entire organisation, should provide measurable value and
solve the real issue rather than generate a new one.”
Jakub Hajek, Cometari
My goal is to show how Traefik can make your daily duties easier if you work
with microservice architectures running in distributed systems.
CONTAINERS
IMMUTABLE CONTAINERS
▸ Mutable vs Immutable
▸ No incremental changes to the image
▸ No more drifting configuration
▸ (No) imperative updates
▸ Base image + source code = An artefact / immutable image
▸ The artefact is scaling unit in distributed systems
▸ Canary and mirror deployments
▸ Rollback if an error occurs
Immutable containers are at the core of any distributed systems
TRAEFIK 2.X
TRAEFIK 2.X KEY FEATURES
▸ TCP support
▸ Kubernetes CRD
▸ ROUTER= frontend, SERVICE=backend, MIDDLEWARES=rules
▸ Fully customisable routes via middleware, which can be reused on many routers
▸ YAML, TOML is still good
▸ A new dashboard with web UI
▸ Canary deployment with Service Load balancer
▸ Network traffic Mirroring with Service Load balancer
▸ Consul catalog
KUBERNETES INGRESS PROVIDER
▸ Traefik can be used as an another ingress provider
▸ Configuration is done via (lots of) annotations
KUBERNETES CRD AND AVAILABLE CUSTOM RESOURCES
▸ Ingressroute - HTTP routing - http router
▸ Middleware - tweaks the HTTP before they are sent to a
service - HTTP Middleware
▸ TraefikService - abstraction for HTTP LB/mirroring
▸ IngressRouteTCP - TCP routing - TCP router
▸ TLSOptions - TLS connection parameters
https://docs.traefik.io/routing/providers/kubernetes-crd/
LETSENCRYPT WITH CRD
▸ Traefik is delivered as an immutable containers
▸ LetsEncrypt keeps persistence in a file
▸ Previous version keeps cert in KV stores (Consul)
▸ The file with cert works fine with only once Traefik instance
▸ SPOF
https://docs.traefik.io/providers/kubernetes-crd/#letsencrypt-support-with-the-custom-resource-definition-provider
IMMUTABLE CONTAINER WITH TRAEFIK
▸ Custom image with Traefik with added SSL certificate into
image
▸ Configuration files added directly to the image
▸ Works perfectly if you bought SSL cert and don’t use
dynamically updated Let’s Encrypt
▸ Horizontal scalability is simple, no need to care about the
persistence for Let’s Encrypt certificates
HA WITH LETSENCRYPT
▸ Traefik EE which supports distributed LetsEncrypt
▸ LetsEncrypt keeps persistence in a file
▸ Previous version keeps cert in KV stores (Consul)
▸ Cert Manager that keeps certificates in secrets
ENTRYPOINTS :80, :443
ROUTERS
PROVIDER 1
Traefik configuration introduction
PROVIDER
CONNECTION
INFORMATION
SERVICES
MIDDLEWARES
CERTIFICATES
PROVIDER 2
DYNAMIC (WHILE RUNNING)STATIC (STARTUP TIME)
ENTRYPOINT ROUTER SERVICE
MIDDLEWARE 1 MIDDLEWARE 2 MIDDLEWARE 3
Request Calls to backend servers
Tweaking request before / after the arrives to their destination
MIRRORING OR LIVE TRAFFIC SHADOW
▸ Understand difference between Deployment vs Release
▸ Deployment brings new code to the production,
no production traffic yet!
▸ Run smoke, integration tests to make sure that new
deployment has no impact to your users
▸ Release brings live traffic to a deployment.
▸ We can shadow live traffic to the new deployment and
reduce the risk of failure.
MIRRORING
VERSION 2
VERSION 1
https://service
Mirroring with Service Load Balancer
20%
https://github.com/containous/traefik/issues/2989
CANARY DEPLOYMENT
▸ Deployment vs Release
▸ Instead of switching to new version in one step, we use a phased
approach
▸ We deploy a new app in a small part of the production
infrastructure
▸ Only a few users (1%) are routed to the newest version (Release)
▸ With no errors reported, the new version can be released to the
rest of the infrastructure.
CANARY
VERSION 2
VERSION 1
https://service
Canary deployment with Service Load balancers
1% of live traffic, a few users
Majority of users
https://github.com/containous/traefik/issues/1164
CANARY VERSION 2
https://service
Canary deployment with Service Load balancers
VERSION 2VERSION 2VERSION 2
OBSERVABILITY
▸ /metrics endpoint
▸ Enable Prometheus or any other backend
▸ Use Grafana to visualise metrics
▸ Use existing dashboards to visualise data (or develop your
own)
LOGGING AND VISUALISING ACCESS LOGS
▸ Traefik logs are in JSON including startup and errors events
▸ Access logs are written to STDOUT in JSON format.
▸ Treat logs as an event and transfer them to external system
(Elastic Stack + Fluentd)
▸ Use Kibana and Logs tab to have live data streaming
▸ Develop dashboard with a map and place GEO points of IP
addresses
TRACING
▸ You can’t just relay on app and system logs
▸ Visualize the requests flows
▸ Traefik uses OpenTracing for distributed tracing
▸ Jeager, Zipkin, Datadag and a few more
CONFIGURATION TIPS
▸ Don’t mix static configuration vs dynamic configuration
▸ CLI command can be used for static config or if you prefer you can define
config file as well
▸ Labels (for Swarm) can be used to define dynamic configuration or config files
▸ directory with WATCH flag enabled as well
▸ More advanced rules configuration via middleware are dynamically defined
▸ The most flexible is to run Traefik as container, instead of binary directly from
host
▸ Healthcheck for your services are crucial
DEMO ENVIRONMENT
DEMO ENVIRONMENT IN DETAILS
▸ K3S cluster* consisting of 3 nodes
▸ INSTALL_K3S_EXEC="server --no-deploy traefik”
▸ SSL certs issued by Lets Encrypt
▸ FQDN domains:
▸ https://a.labs.cometari.eu
▸ https://n.labs.cometari.eu
▸ https://c.labs.cometari.eu
▸ DNS Round Robin: Route 53 with its implemented health checks
▸ Web Server and NodeJS backend
Diagram of demo environment
TRAEFIK
WEB FRONTEND
NODEJS BACKEND
Talk is cheap, show me the code!
DEMO TIME
DEMO SCENARIOS
▸ Web UI to see how services are deployed
▸ Scaling services and generating some network traffic via
Slapper
▸ Example of Canary deployment
▸ Example of Mirroring configuration
SUMMARY
▸ Traefik provides flexible way to expose services, auto discovery
▸ It can be configured in multiple way, there are no ready to use config - just
refer to configuration tips
▸ Fully customise routes via middlewares
▸ Easily integrates with every major cluster technology
▸ Lets Encrypt integrated, managing SSL certs is easy
▸ Metrics, Tracing, Logs
▸ Rolling out releases thanks to Canary deployments
▸ Mirroring - duplicating incoming request and send them to different services.
THANK YOU
@_JAKUBHAJEK
JAKUB.HAJEK@COMETARI.COM

Weitere ähnliche Inhalte

Was ist angesagt?

Deploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersDeploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersImesh Gunaratne
 
The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptDocker, Inc.
 
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
Docker for Mac and Windows: The Insider's Guide by Justin CormackDocker for Mac and Windows: The Insider's Guide by Justin Cormack
Docker for Mac and Windows: The Insider's Guide by Justin CormackDocker, Inc.
 
In-Cluster Continuous Testing Framework for Docker Containers
In-Cluster Continuous Testing Framework for Docker ContainersIn-Cluster Continuous Testing Framework for Docker Containers
In-Cluster Continuous Testing Framework for Docker ContainersNeil Gehani
 
Troubleshooting tips from docker support engineers
Troubleshooting tips from docker support engineersTroubleshooting tips from docker support engineers
Troubleshooting tips from docker support engineersDocker, Inc.
 
How Ansible Tower and Prometheus can help automate continuous deployments
How Ansible Tower and Prometheus can help automate continuous deployments How Ansible Tower and Prometheus can help automate continuous deployments
How Ansible Tower and Prometheus can help automate continuous deployments Roger Tanner
 
Beginners Guide to Kontena
Beginners Guide to KontenaBeginners Guide to Kontena
Beginners Guide to KontenaLauri Nevala
 
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...Docker, Inc.
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetesWilliam Stewart
 
Containerizing Network Services - Alon Harel - OpenStack Day Israel 2016
Containerizing Network Services - Alon Harel - OpenStack Day Israel 2016Containerizing Network Services - Alon Harel - OpenStack Day Israel 2016
Containerizing Network Services - Alon Harel - OpenStack Day Israel 2016Cloud Native Day Tel Aviv
 
WSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2Con ASIA 2016: WSO2 Cloud Strategy UpdateWSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2Con ASIA 2016: WSO2 Cloud Strategy UpdateWSO2
 
Current Status of Kubernetes-powered Docker for Mac Platform
Current Status of Kubernetes-powered Docker for Mac PlatformCurrent Status of Kubernetes-powered Docker for Mac Platform
Current Status of Kubernetes-powered Docker for Mac PlatformAjeet Singh Raina
 
Going deep (learning) with tensor flow and quarkus
Going deep (learning) with tensor flow and quarkusGoing deep (learning) with tensor flow and quarkus
Going deep (learning) with tensor flow and quarkusRed Hat Developers
 
Monitoring kubernetes with prometheus
Monitoring kubernetes with prometheusMonitoring kubernetes with prometheus
Monitoring kubernetes with prometheusBrice Fernandes
 
WSO2 Cloud and Platform as a Service Strategy
WSO2 Cloud and Platform as a Service StrategyWSO2 Cloud and Platform as a Service Strategy
WSO2 Cloud and Platform as a Service StrategyImesh Gunaratne
 
OMG Namespaces! | Raffaele Di Fazio
OMG Namespaces! | Raffaele Di FazioOMG Namespaces! | Raffaele Di Fazio
OMG Namespaces! | Raffaele Di FazioKCDItaly
 
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-Compose
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-ComposeTales of Training: Scaling CodeLabs with Swarm Mode and Docker-Compose
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-ComposeDocker, Inc.
 
OpenStack Preso: DevOps on Hybrid Infrastructure
OpenStack Preso: DevOps on Hybrid InfrastructureOpenStack Preso: DevOps on Hybrid Infrastructure
OpenStack Preso: DevOps on Hybrid Infrastructurerhirschfeld
 

Was ist angesagt? (20)

Deploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersDeploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on Containers
 
The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build Script
 
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
Docker for Mac and Windows: The Insider's Guide by Justin CormackDocker for Mac and Windows: The Insider's Guide by Justin Cormack
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
 
In-Cluster Continuous Testing Framework for Docker Containers
In-Cluster Continuous Testing Framework for Docker ContainersIn-Cluster Continuous Testing Framework for Docker Containers
In-Cluster Continuous Testing Framework for Docker Containers
 
Troubleshooting tips from docker support engineers
Troubleshooting tips from docker support engineersTroubleshooting tips from docker support engineers
Troubleshooting tips from docker support engineers
 
How Ansible Tower and Prometheus can help automate continuous deployments
How Ansible Tower and Prometheus can help automate continuous deployments How Ansible Tower and Prometheus can help automate continuous deployments
How Ansible Tower and Prometheus can help automate continuous deployments
 
Beginners Guide to Kontena
Beginners Guide to KontenaBeginners Guide to Kontena
Beginners Guide to Kontena
 
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Containerizing Network Services - Alon Harel - OpenStack Day Israel 2016
Containerizing Network Services - Alon Harel - OpenStack Day Israel 2016Containerizing Network Services - Alon Harel - OpenStack Day Israel 2016
Containerizing Network Services - Alon Harel - OpenStack Day Israel 2016
 
GitLab on OpenShift
GitLab on OpenShiftGitLab on OpenShift
GitLab on OpenShift
 
WSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2Con ASIA 2016: WSO2 Cloud Strategy UpdateWSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2Con ASIA 2016: WSO2 Cloud Strategy Update
 
Current Status of Kubernetes-powered Docker for Mac Platform
Current Status of Kubernetes-powered Docker for Mac PlatformCurrent Status of Kubernetes-powered Docker for Mac Platform
Current Status of Kubernetes-powered Docker for Mac Platform
 
Going deep (learning) with tensor flow and quarkus
Going deep (learning) with tensor flow and quarkusGoing deep (learning) with tensor flow and quarkus
Going deep (learning) with tensor flow and quarkus
 
Monitoring kubernetes with prometheus
Monitoring kubernetes with prometheusMonitoring kubernetes with prometheus
Monitoring kubernetes with prometheus
 
WSO2 Cloud and Platform as a Service Strategy
WSO2 Cloud and Platform as a Service StrategyWSO2 Cloud and Platform as a Service Strategy
WSO2 Cloud and Platform as a Service Strategy
 
OMG Namespaces! | Raffaele Di Fazio
OMG Namespaces! | Raffaele Di FazioOMG Namespaces! | Raffaele Di Fazio
OMG Namespaces! | Raffaele Di Fazio
 
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-Compose
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-ComposeTales of Training: Scaling CodeLabs with Swarm Mode and Docker-Compose
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-Compose
 
My kubernetes toolkit
My kubernetes toolkitMy kubernetes toolkit
My kubernetes toolkit
 
OpenStack Preso: DevOps on Hybrid Infrastructure
OpenStack Preso: DevOps on Hybrid InfrastructureOpenStack Preso: DevOps on Hybrid Infrastructure
OpenStack Preso: DevOps on Hybrid Infrastructure
 

Ähnlich wie Traefik as an open source edge router for microservice architectures

Container Orchestration with Traefik 2.x
Container Orchestration with Traefik 2.xContainer Orchestration with Traefik 2.x
Container Orchestration with Traefik 2.xJakub Hajek
 
Canary deployment with Traefik and K3S
Canary deployment with Traefik and K3SCanary deployment with Traefik and K3S
Canary deployment with Traefik and K3SJakub Hajek
 
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfskJuraj Hantak
 
Cloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit KubernetesCloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit KubernetesQAware GmbH
 
Full stack development best practice and toolset
Full stack development best practice and toolsetFull stack development best practice and toolset
Full stack development best practice and toolsetReid Lai
 
Containerising bootiful microservices javaeeconf
Containerising bootiful microservices javaeeconfContainerising bootiful microservices javaeeconf
Containerising bootiful microservices javaeeconfIvan Vasyliev
 
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAconCloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAconMario-Leander Reimer
 
JDO 2019: Container orchestration with Docker Swarm - Jakub Hajek
JDO 2019: Container orchestration with Docker Swarm - Jakub HajekJDO 2019: Container orchestration with Docker Swarm - Jakub Hajek
JDO 2019: Container orchestration with Docker Swarm - Jakub HajekPROIDEA
 
What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017Patrick Chanezon
 
Build cloud native solution using open source
Build cloud native solution using open source Build cloud native solution using open source
Build cloud native solution using open source Nitesh Jadhav
 
How to Design a Backend for IoT
How to Design a Backend for IoTHow to Design a Backend for IoT
How to Design a Backend for IoTİbrahim Gürses
 
Pivotal Container Service (PKS) at SF Cloud Foundry Meetup
Pivotal Container Service (PKS) at SF Cloud Foundry MeetupPivotal Container Service (PKS) at SF Cloud Foundry Meetup
Pivotal Container Service (PKS) at SF Cloud Foundry Meetupcornelia davis
 
Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...Bilgin Ibryam
 
The path to a serverless-native era with Kubernetes
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetessparkfabrik
 
Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Velocidex Enterprises
 
Scaling Microservices with Kubernetes
Scaling Microservices with KubernetesScaling Microservices with Kubernetes
Scaling Microservices with KubernetesDeivid Hahn Fração
 
Docker, cornerstone of an hybrid cloud?
Docker, cornerstone of an hybrid cloud?Docker, cornerstone of an hybrid cloud?
Docker, cornerstone of an hybrid cloud?Adrien Blind
 
Webinar: Dealing with automation tool overload!
Webinar: Dealing with automation tool overload!Webinar: Dealing with automation tool overload!
Webinar: Dealing with automation tool overload!Cloudify Community
 
Cloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudCloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudConor Svensson
 

Ähnlich wie Traefik as an open source edge router for microservice architectures (20)

Container Orchestration with Traefik 2.x
Container Orchestration with Traefik 2.xContainer Orchestration with Traefik 2.x
Container Orchestration with Traefik 2.x
 
Canary deployment with Traefik and K3S
Canary deployment with Traefik and K3SCanary deployment with Traefik and K3S
Canary deployment with Traefik and K3S
 
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
 
How Postman adopted Docker
How Postman adopted DockerHow Postman adopted Docker
How Postman adopted Docker
 
Cloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit KubernetesCloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit Kubernetes
 
Full stack development best practice and toolset
Full stack development best practice and toolsetFull stack development best practice and toolset
Full stack development best practice and toolset
 
Containerising bootiful microservices javaeeconf
Containerising bootiful microservices javaeeconfContainerising bootiful microservices javaeeconf
Containerising bootiful microservices javaeeconf
 
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAconCloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
 
JDO 2019: Container orchestration with Docker Swarm - Jakub Hajek
JDO 2019: Container orchestration with Docker Swarm - Jakub HajekJDO 2019: Container orchestration with Docker Swarm - Jakub Hajek
JDO 2019: Container orchestration with Docker Swarm - Jakub Hajek
 
What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017
 
Build cloud native solution using open source
Build cloud native solution using open source Build cloud native solution using open source
Build cloud native solution using open source
 
How to Design a Backend for IoT
How to Design a Backend for IoTHow to Design a Backend for IoT
How to Design a Backend for IoT
 
Pivotal Container Service (PKS) at SF Cloud Foundry Meetup
Pivotal Container Service (PKS) at SF Cloud Foundry MeetupPivotal Container Service (PKS) at SF Cloud Foundry Meetup
Pivotal Container Service (PKS) at SF Cloud Foundry Meetup
 
Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...
 
The path to a serverless-native era with Kubernetes
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetes
 
Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3
 
Scaling Microservices with Kubernetes
Scaling Microservices with KubernetesScaling Microservices with Kubernetes
Scaling Microservices with Kubernetes
 
Docker, cornerstone of an hybrid cloud?
Docker, cornerstone of an hybrid cloud?Docker, cornerstone of an hybrid cloud?
Docker, cornerstone of an hybrid cloud?
 
Webinar: Dealing with automation tool overload!
Webinar: Dealing with automation tool overload!Webinar: Dealing with automation tool overload!
Webinar: Dealing with automation tool overload!
 
Cloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudCloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring Cloud
 

Mehr von Jakub Hajek

Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackJakub Hajek
 
Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Jakub Hajek
 
Container Orchestration with Traefk on Docker Swarm
Container Orchestration with Traefk on Docker SwarmContainer Orchestration with Traefk on Docker Swarm
Container Orchestration with Traefk on Docker SwarmJakub Hajek
 
Cometari Dedicated Solutions Company Presentation
Cometari Dedicated Solutions Company PresentationCometari Dedicated Solutions Company Presentation
Cometari Dedicated Solutions Company PresentationJakub Hajek
 
Cometari Dedicated Solutions Oferta ogólna
Cometari Dedicated Solutions Oferta ogólnaCometari Dedicated Solutions Oferta ogólna
Cometari Dedicated Solutions Oferta ogólnaJakub Hajek
 
Cometari Dedicated Solutions General Offer
Cometari Dedicated Solutions General OfferCometari Dedicated Solutions General Offer
Cometari Dedicated Solutions General OfferJakub Hajek
 

Mehr von Jakub Hajek (6)

Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic Stack
 
Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0
 
Container Orchestration with Traefk on Docker Swarm
Container Orchestration with Traefk on Docker SwarmContainer Orchestration with Traefk on Docker Swarm
Container Orchestration with Traefk on Docker Swarm
 
Cometari Dedicated Solutions Company Presentation
Cometari Dedicated Solutions Company PresentationCometari Dedicated Solutions Company Presentation
Cometari Dedicated Solutions Company Presentation
 
Cometari Dedicated Solutions Oferta ogólna
Cometari Dedicated Solutions Oferta ogólnaCometari Dedicated Solutions Oferta ogólna
Cometari Dedicated Solutions Oferta ogólna
 
Cometari Dedicated Solutions General Offer
Cometari Dedicated Solutions General OfferCometari Dedicated Solutions General Offer
Cometari Dedicated Solutions General Offer
 

Kürzlich hochgeladen

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Traefik as an open source edge router for microservice architectures

  • 1. TRAEFIK AS AN OPEN SOURCE EDGE ROUTER FOR MICROSERVICE ARCHITECTURES JAKUB HAJEK FEB 27TH, 2020
  • 2. ▸ I am the owner and technical consultant working for Cometari ▸ I’ve been system admin since 1998 ▸ Cometari is a solutions company implementing DevOps culture and providing consultancy, workshops and software services. ▸ Our expertise are DevOps, Elastic Stack - log analysis, ▸ We are deeply involved in the travel tech industry ▸ However our solutions go much further than just integrating travel API’s. INTRODUCTION
  • 3. “I strongly believe that implementing DevOps culture, across the entire organisation, should provide measurable value and solve the real issue rather than generate a new one.” Jakub Hajek, Cometari
  • 4. My goal is to show how Traefik can make your daily duties easier if you work with microservice architectures running in distributed systems.
  • 6. IMMUTABLE CONTAINERS ▸ Mutable vs Immutable ▸ No incremental changes to the image ▸ No more drifting configuration ▸ (No) imperative updates ▸ Base image + source code = An artefact / immutable image ▸ The artefact is scaling unit in distributed systems ▸ Canary and mirror deployments ▸ Rollback if an error occurs
  • 7. Immutable containers are at the core of any distributed systems
  • 9. TRAEFIK 2.X KEY FEATURES ▸ TCP support ▸ Kubernetes CRD ▸ ROUTER= frontend, SERVICE=backend, MIDDLEWARES=rules ▸ Fully customisable routes via middleware, which can be reused on many routers ▸ YAML, TOML is still good ▸ A new dashboard with web UI ▸ Canary deployment with Service Load balancer ▸ Network traffic Mirroring with Service Load balancer ▸ Consul catalog
  • 10. KUBERNETES INGRESS PROVIDER ▸ Traefik can be used as an another ingress provider ▸ Configuration is done via (lots of) annotations
  • 11. KUBERNETES CRD AND AVAILABLE CUSTOM RESOURCES ▸ Ingressroute - HTTP routing - http router ▸ Middleware - tweaks the HTTP before they are sent to a service - HTTP Middleware ▸ TraefikService - abstraction for HTTP LB/mirroring ▸ IngressRouteTCP - TCP routing - TCP router ▸ TLSOptions - TLS connection parameters https://docs.traefik.io/routing/providers/kubernetes-crd/
  • 12. LETSENCRYPT WITH CRD ▸ Traefik is delivered as an immutable containers ▸ LetsEncrypt keeps persistence in a file ▸ Previous version keeps cert in KV stores (Consul) ▸ The file with cert works fine with only once Traefik instance ▸ SPOF https://docs.traefik.io/providers/kubernetes-crd/#letsencrypt-support-with-the-custom-resource-definition-provider
  • 13. IMMUTABLE CONTAINER WITH TRAEFIK ▸ Custom image with Traefik with added SSL certificate into image ▸ Configuration files added directly to the image ▸ Works perfectly if you bought SSL cert and don’t use dynamically updated Let’s Encrypt ▸ Horizontal scalability is simple, no need to care about the persistence for Let’s Encrypt certificates
  • 14. HA WITH LETSENCRYPT ▸ Traefik EE which supports distributed LetsEncrypt ▸ LetsEncrypt keeps persistence in a file ▸ Previous version keeps cert in KV stores (Consul) ▸ Cert Manager that keeps certificates in secrets
  • 15. ENTRYPOINTS :80, :443 ROUTERS PROVIDER 1 Traefik configuration introduction PROVIDER CONNECTION INFORMATION SERVICES MIDDLEWARES CERTIFICATES PROVIDER 2 DYNAMIC (WHILE RUNNING)STATIC (STARTUP TIME)
  • 16. ENTRYPOINT ROUTER SERVICE MIDDLEWARE 1 MIDDLEWARE 2 MIDDLEWARE 3 Request Calls to backend servers Tweaking request before / after the arrives to their destination
  • 17. MIRRORING OR LIVE TRAFFIC SHADOW ▸ Understand difference between Deployment vs Release ▸ Deployment brings new code to the production, no production traffic yet! ▸ Run smoke, integration tests to make sure that new deployment has no impact to your users ▸ Release brings live traffic to a deployment. ▸ We can shadow live traffic to the new deployment and reduce the risk of failure.
  • 18. MIRRORING VERSION 2 VERSION 1 https://service Mirroring with Service Load Balancer 20% https://github.com/containous/traefik/issues/2989
  • 19. CANARY DEPLOYMENT ▸ Deployment vs Release ▸ Instead of switching to new version in one step, we use a phased approach ▸ We deploy a new app in a small part of the production infrastructure ▸ Only a few users (1%) are routed to the newest version (Release) ▸ With no errors reported, the new version can be released to the rest of the infrastructure.
  • 20. CANARY VERSION 2 VERSION 1 https://service Canary deployment with Service Load balancers 1% of live traffic, a few users Majority of users https://github.com/containous/traefik/issues/1164
  • 21. CANARY VERSION 2 https://service Canary deployment with Service Load balancers VERSION 2VERSION 2VERSION 2
  • 22. OBSERVABILITY ▸ /metrics endpoint ▸ Enable Prometheus or any other backend ▸ Use Grafana to visualise metrics ▸ Use existing dashboards to visualise data (or develop your own)
  • 23. LOGGING AND VISUALISING ACCESS LOGS ▸ Traefik logs are in JSON including startup and errors events ▸ Access logs are written to STDOUT in JSON format. ▸ Treat logs as an event and transfer them to external system (Elastic Stack + Fluentd) ▸ Use Kibana and Logs tab to have live data streaming ▸ Develop dashboard with a map and place GEO points of IP addresses
  • 24. TRACING ▸ You can’t just relay on app and system logs ▸ Visualize the requests flows ▸ Traefik uses OpenTracing for distributed tracing ▸ Jeager, Zipkin, Datadag and a few more
  • 25. CONFIGURATION TIPS ▸ Don’t mix static configuration vs dynamic configuration ▸ CLI command can be used for static config or if you prefer you can define config file as well ▸ Labels (for Swarm) can be used to define dynamic configuration or config files ▸ directory with WATCH flag enabled as well ▸ More advanced rules configuration via middleware are dynamically defined ▸ The most flexible is to run Traefik as container, instead of binary directly from host ▸ Healthcheck for your services are crucial
  • 27. DEMO ENVIRONMENT IN DETAILS ▸ K3S cluster* consisting of 3 nodes ▸ INSTALL_K3S_EXEC="server --no-deploy traefik” ▸ SSL certs issued by Lets Encrypt ▸ FQDN domains: ▸ https://a.labs.cometari.eu ▸ https://n.labs.cometari.eu ▸ https://c.labs.cometari.eu ▸ DNS Round Robin: Route 53 with its implemented health checks ▸ Web Server and NodeJS backend
  • 28. Diagram of demo environment TRAEFIK WEB FRONTEND NODEJS BACKEND
  • 29. Talk is cheap, show me the code!
  • 31. DEMO SCENARIOS ▸ Web UI to see how services are deployed ▸ Scaling services and generating some network traffic via Slapper ▸ Example of Canary deployment ▸ Example of Mirroring configuration
  • 32. SUMMARY ▸ Traefik provides flexible way to expose services, auto discovery ▸ It can be configured in multiple way, there are no ready to use config - just refer to configuration tips ▸ Fully customise routes via middlewares ▸ Easily integrates with every major cluster technology ▸ Lets Encrypt integrated, managing SSL certs is easy ▸ Metrics, Tracing, Logs ▸ Rolling out releases thanks to Canary deployments ▸ Mirroring - duplicating incoming request and send them to different services.