Giter Site home page Giter Site logo

samarpanda / traefik-demo Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 73 KB

Traefik: Modern HTTP reverse proxy and load balancing that makes deploying microservices easy

Dockerfile 20.13% JavaScript 76.95% Shell 2.92%
traefik traefik-v2 docker docker-compose nodejs reverse-proxy loadbalancing microservice microservices-architecture microservices-demo

traefik-demo's Introduction

Traefik demo

Modern HTTP Reverse proxy and load balacning that makes deploying microservices easy.

Features

  1. Traefik used as reverse proxy
  2. Configure microservices with automatic service discovery
  3. Automatic loadbalancing of each service with multiple containers

Prerequisites

Docker & GIT needs to be configured

Quick commands

  1. docker-compose up -d - Will start all application together
  2. docker-compose up -d --build - Rebuild if you have file changes
  3. docker-compose up -d proxy
  4. docker-compose up -d pino
  5. docker-compose up -d mino
  6. docker-compose up -d whoami
  7. docker-compose up -d --scale whoami=2 - Automatic load-balancing by traefik for two containers for the same service.

Testing Service

  1. Pino service - curl -H Host:pino.docker.localhost http://127.0.0.1:3000
  2. Mino service - curl -H Host:mino.docker.localhost http://127.0.0.1:3000
  3. Inter service communication - curl -H Host:pino.docker.localhost http://127.0.0.1:3000/mino

Request to different services

  1. Req to pino serice - curl -H Host:pino.docker.localhost http://127.0.0.1:3000
  2. Req to whoami service - curl -H Host:whoami.docker.localhost http://127.0.0.1:3000

Internal communication within services

  1. Use service name and internal port.

Traefik internal data links

  1. Service discovery on traefik routes & services - JSON data link
  2. Traefik dashboard
  3. Load balancing and reverse proxy with traefik

References

  1. Traefik & containers
  2. Awesome Traefik

Communication between microservices

  1. stackoverflow

  2. Containous builds a service mesh on its traefik proxy

  3. Simpler service mesh

Docker compose docs

  1. docker-compose 3

  2. devhints docker-compose cheatsheet

Docker

  1. docker-cheat-sheet

  2. docker network prune - This will remove all networks not used by at least one container.

Others

  1. traefik digitalocean setup

  2. Consul & traefik catalogue example

  3. Using LXD and Ansible to simulate infrastructure

traefik-demo's People

Contributors

dependabot[bot] avatar samarpanda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.