mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-27 23:46:36 +01:00
124e619f082f0afcc896f3955087fbbff45b25fb
Traefik Ondemand Plugin
Traefik middleware to start containers on demand.
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)
Usage
Plugin configuration
testData:
serviceUrl: http://ondemand:10000
name: TRAEFIK_HACKATHON_whoami
timeout: 1m
| Parameter | Type | Example | Description |
|---|---|---|---|
serviceUrl |
string |
http://ondemand:10000 |
The docker container name, or the swarm service name |
name |
string |
TRAEFIK_HACKATHON_whoami |
The container/service to be stopped (docker ps |
timeout |
time.Duration |
1m30s |
The duration after which the container/service will be scaled down to 0 |
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
Authors
Alexis Couvreur (left) Alexandre Hiltcher (middle) Matthias Schneider (right)
Languages
Go
89.4%
HTML
9.9%
Makefile
0.6%
Dockerfile
0.1%

