Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acouvreur/traefik-ondemand-service
Traefik ondemand service for the traefik ondemand plugin
https://github.com/acouvreur/traefik-ondemand-service
containers docker docker-swarm golang hacktoberfest kubernetes ondemand scale swarm traefik
Last synced: 2 months ago
JSON representation
Traefik ondemand service for the traefik ondemand plugin
- Host: GitHub
- URL: https://github.com/acouvreur/traefik-ondemand-service
- Owner: acouvreur
- License: apache-2.0
- Archived: true
- Created: 2020-10-20T20:02:44.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-24T01:27:11.000Z (about 2 years ago)
- Last Synced: 2024-08-02T15:48:23.098Z (6 months ago)
- Topics: containers, docker, docker-swarm, golang, hacktoberfest, kubernetes, ondemand, scale, swarm, traefik
- Language: Go
- Homepage: https://pilot.traefik.io/plugins/605afbdba5f67ab9a1b0e53a/containers-on-demand
- Size: 91.8 KB
- Stars: 36
- Watchers: 4
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - acouvreur/traefik-ondemand-service - Traefik ondemand service for the traefik ondemand plugin (kubernetes)
README
**Project achieved, please see [acouvreur/sablier](https://github.com/acouvreur/sablier)**
Traefik Ondemand Service
Traefik Ondemand Service for traefik-ondemand-plugin to control containers and services.
## 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
- Dynamic loading page (cloudflare or grafana cloud style)
- Automatic scale to zero after configured timeout upon last request the service received
- Support container/service healthcheck and will not redirect until service is healthy## Usage
### CLI
`./traefik-ondemand-service --swarmMode=true --kubernetesMode=false`
| Argument | Value | Description |
| ---------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `swarmMode` | true,false (default true) | Enable/Disable swarm mode. Used to determine the scaler implementation. |
| `kubernetesMode` | true,false (default false) | Enable/Disable Kubernetes mode. Used to determine the scaler implementation. |
| `storagePath` | path/to/storage/file (default nil) | Enables persistent storage, file will be used to load previous state upon starting and will sync the current content to memory into the file every 5 seconds |### Docker
- Docker Hub `acouvreur/traefik-ondemand-service`
- Ghcr `ghcr.io/acouvreur/traefik-ondemand-service``docker run -v /var/run/docker.sock:/var/run/docker.sock -p 10000:10000 ghcr.io/acouvreur/traefik-ondemand-service:latest --swarmode=true`
### Kubernetes
see KUBERNETES.md
### API
```
GET :10000/?name=&timeout=
```| Query param | Type | Description |
| ----------- | --------------- | ----------------------------------------------------------------------- |
| `name` | `string` | The docker container name, or the swarm service name |
| `timeout` | `time.Duration` | The duration after which the container/service will be scaled down to 0 || Body | Status code | Description |
| ---------- | ------------ | ------------------------------------------------------------------------------ |
| `started` | 202 Created | The container/service is available |
| `starting` | 201 Accepted | The container/service has been scheduled for starting but is not yet available |