Added demo

This commit is contained in:
Alexis Couvreur
2020-10-21 22:05:20 +02:00
parent d355197150
commit cc269ebb47
3 changed files with 26 additions and 9 deletions

View File

@@ -1,16 +1,33 @@
# Traefik Ondemand Plugin
Traefik plugin to scale containers ondemand
Traefik plugin to scale down to zero containers on swarm.
## How to use it
## Description
### Required
A container may be a simple nginx server serving static pages, when no one is using it, it still consome CPU and memory even if it's close to nothing it still something.
- Swarm mode
- [Traefik ondemand service](https://github.com/acouvreur/traefik-ondemand-service) up and running
With this plugin you can scale down to zero when there is no more request.
It will scale back to 1 when there is a user requesting the service.
## Develop the plugin
## Authors
`export TRAEFIK_PILOT_TOKEN=traefik_pilot_token`
`docker swarm init`
`docker stack deploy -c docker-compose.yml TRAEFIK_HACKATHON`
[Alexandre Hiltcher](https://www.linkedin.com/in/alexandre-hiltcher/)
[Alexis Couvreur](https://www.linkedin.com/in/alexis-couvreur/)
![Alexandre and Alexis](./img/gophers-traefik.png)
## Demo
![Demo](./img/demo.gif)
## Run the demo
- `docker swarm init`
- `export TRAEFIK_PILOT_TOKEN=your_traefik_pilot_token`
- `docker stack deploy -c docker-compose.yml TRAEFIK_HACKATHON`
## Limitations
You cannot set the labels for a service inside the service definition.
Otherwise when scaling to 0 the specification would not be found because there is no more task running. So you have to write it under the dynamic configuration file.

BIN
img/demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
img/gophers-traefik.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB