All Projects → acouvreur → traefik-ondemand-plugin

acouvreur / traefik-ondemand-plugin

Licence: Apache-2.0 license
Traefik plugin to scale containers on demand

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to traefik-ondemand-plugin

trafficjam
A Docker firewall for your reverse proxy network
Stars: ✭ 79 (-46.98%)
Mutual labels:  docker-swarm, swarm, traefik
traefik-ondemand-service
Traefik ondemand service for the traefik ondemand plugin
Stars: ✭ 35 (-76.51%)
Mutual labels:  docker-swarm, swarm, traefik
Fabricio
Docker deploy automation tool
Stars: ✭ 250 (+67.79%)
Mutual labels:  docker-swarm, swarm
generator-mitosis
A micro-service infrastructure generator based on Yeoman/Chatbot, Kubernetes/Docker Swarm, Traefik, Ansible, Jenkins, Spark, Hadoop, Kafka, etc.
Stars: ✭ 78 (-47.65%)
Mutual labels:  swarm, traefik
swarm-router
Scalable stateless «zero config» service-name ingress for docker swarm mode with a fresh more secure approach
Stars: ✭ 58 (-61.07%)
Mutual labels:  docker-swarm, swarm
Swarmpit
Lightweight mobile-friendly Docker Swarm management UI
Stars: ✭ 2,255 (+1413.42%)
Mutual labels:  docker-swarm, swarm
Swarmstack
A Docker swarm-based starting point for operating highly-available containerized applications.
Stars: ✭ 181 (+21.48%)
Mutual labels:  docker-swarm, swarm
plugin-rewritebody
No description or website provided.
Stars: ✭ 33 (-77.85%)
Mutual labels:  traefik, traefik-plugin
Time2code
Portable Scalable web code editor to integrate into your sites and learning experiences
Stars: ✭ 294 (+97.32%)
Mutual labels:  docker-swarm, swarm
clusterplex
ClusterPlex is basically an extended version of Plex, which supports distributed Workers across a cluster to handle transcoding requests.
Stars: ✭ 123 (-17.45%)
Mutual labels:  docker-swarm, swarm
docker-box
A lightweight docker application platform for single servers.
Stars: ✭ 62 (-58.39%)
Mutual labels:  docker-swarm, traefik
htransformation
A Traefik plugin to change on the fly header's value of a request
Stars: ✭ 44 (-70.47%)
Mutual labels:  traefik, traefik-plugin
Miniswarm
Docker Swarm cluster in one command
Stars: ✭ 130 (-12.75%)
Mutual labels:  docker-swarm, swarm
Docker Swarm Cookbook
A large collection of recipes for a complete, self-hosted Docker Swarm stack including Traefik v2 and SSO/Auth
Stars: ✭ 49 (-67.11%)
Mutual labels:  docker-swarm, swarm
Docker Traefik Prometheus
A Docker Swarm Stack for monitoring Traefik with Promethues and Grafana
Stars: ✭ 215 (+44.3%)
Mutual labels:  docker-swarm, swarm
Dockercheatsheet
🐋 Docker Cheat Sheet 🐋
Stars: ✭ 3,301 (+2115.44%)
Mutual labels:  docker-swarm, swarm
LilSholex
A project containing web apps and Telegram API bots.
Stars: ✭ 32 (-78.52%)
Mutual labels:  docker-swarm, swarm
pirate
🏴‍☠️ A personal platform for R programming
Stars: ✭ 36 (-75.84%)
Mutual labels:  docker-swarm, traefik
souin
An HTTP cache system, RFC compliant, compatible with @TykTechnologies, @traefik, @caddyserver, @go-chi, @bnkamalesh, @beego, @devfeel, @labstack, @gofiber, @go-goyave, @gin-gonic, @zalando, @zeromicro, @nginx and @apache
Stars: ✭ 269 (+80.54%)
Mutual labels:  traefik, traefik-plugin
traefik-private-plugins
Automatic patch for Traefik supporting private plugins
Stars: ✭ 21 (-85.91%)
Mutual labels:  traefik, traefik-plugin

Traefik Ondemand Plugin

Traefik middleware to start containers on demand.

Github Actions Go Report Go Version Latest Release

Features

  • Support for Docker containers
  • Support for Docker swarm mode, scale services
  • Support for Kubernetes Deployments and Statefulsets
  • Start your container/service on the first request
  • Automatic scale to zero after configured timeout upon last request the service received
  • Dynamic loading page (cloudflare or grafana cloud style)
  • Customize dynamic and loading pages

Demo

Usage

Plugin configuration

Strategies

Dynamic Strategy (default)

Serve an HTML page that self reload.

testData:
  serviceUrl: http://ondemand:10000
  name: TRAEFIK_HACKATHON_whoami
  timeout: 1m
  waitui: true

Blocking Strategy

Blocking strategy is enabled by setting waitui to false.

Instead of displaying a self refreshing page, the request hangs until the service is ready to receive the request.

The timeout is set by blockdelay.

testData:
  serviceUrl: http://ondemand:10000
  name: TRAEFIK_HACKATHON_whoami
  timeout: 1m
  waitui: false
  blockdelay: 1m

Typical use case: an API calling another API

Custom loading/error pages

The loadingpage and errorpage keys in the plugin configuration can be used to override the default loading and error pages.

The value should be a path where a template that can be parsed by Go's html/template package can be found in the Traefik container.

An example of both a loading page and an error page template can be found in the pkg/pages/ directory in loading.html and error.html respectively.

The plugin will default to the built-in loading and error pages if these fields are omitted.

You must include <meta http-equiv="refresh" content="5" /> inside your html page to get auto refresh.

Example Configuration

testData:
  serviceUrl: http://ondemand:10000
  name: TRAEFIK_HACKATHON_whoami
  timeout: 1m
  waitui: false
  blockdelay: 1m
  loadingpage: /etc/traefik/plugins/traefik-ondemand-plugin/custompages/loading.html
  errorpage: /etc/traefik/plugins/traefik-ondemand-plugin/custompages/error.html
Parameter Type Default Required Example Description
serviceUrl string empty yes http://ondemand:10000 The docker container name, or the swarm service name
name string empty yes TRAEFIK_HACKATHON_whoami The container/service to be stopped (docker ps docker service ls)
timeout time.Duration 1m no 1m30s The duration after which the container/service will be scaled down to 0
waitui bool true no true Serves a self-refreshing html page when the service is scaled down to 0
blockdelay time.Duration 1m no 1m30s When waitui is false, wait for the service to be scaled up before blockdelay
loadingpage string empty no /etc/traefik/plugins/traefik-ondemand-plugin/custompages/loading.html The path in the traefik container for the loading page template
errorpage string empty no /etc/traefik/plugins/traefik-ondemand-plugin/custompages/error.html The path in the traefik container for the error page template

Traefik-Ondemand-Service

The traefik-ondemand-service must be used to bypass Yaegi limitations.

Yaegi is the interpreter used by Traefik to load plugin and run them at runtime.

The docker library that interacts with the docker deamon uses unsafe which must be specified when instanciating Yaegi. Traefik doesn't, and probably never will by default.

Examples

Development

export TRAEFIK_PILOT_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx docker stack deploy -c docker-compose.yml TRAEFIK_HACKATHON

Authors

Alexis Couvreur (left) Alexandre Hiltcher (middle) Matthias Schneider (right)

Alexandre, Alexis and Matthias

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].