AutoScaler utility for docker swarm
1.8K
⚠️ Warning
This image is still under testing.
A containerized service for automatic scaling of Docker Swarm services, designed for the ETL Design ecosystem. The autoscaler monitors resource usage and adjusts the number of replicas for each service based on real-time metrics.
Make sure Prometheus is running and scraping metrics from your Docker nodes (e.g., via cAdvisor).
PROMETHEUS_URL (required): URL of your Prometheus server (e.g., http://prometheus:9090/).STACK_NAME (required): Name of the Docker stack to manage.CHECK_INVERVAL: How often to check services (seconds, default: 30).COOLDOWN_PERIOD: Minimum seconds between scaling actions for a service (default: 180).DEFAULT_MIN_REPLICAS: Default minimum replicas if not set via label (default: 1).DEFAULT_MAX_REPLICAS: Default maximum replicas if not set via label (default: 10).DEBUG: Set to true for debug logging.Add these labels to your Docker services to enable autoscaling:
scaler.enabled=true (required): Enable autoscaling for this service.scaler.min: Minimum number of replicas.scaler.max: Maximum number of replicas (-1, on-demand, or unlimited for no limit).scaler.metric: Metric to use (cpu or memory).scaler.up: CPU/memory percentage to scale up (default: 75).scaler.down: CPU/memory percentage to scale down (default: 25).scaler.query: (optional) Custom Prometheus query for advanced scenarios.docker run \
-e PROMETHEUS_URL=http://prometheus:9090/ \
-e STACK_NAME=my-stack \
-e DEBUG=true \
vulcan99/autoscaler:latest
services:
myservice:
image: myimage:latest
deploy:
replicas: 2
labels:
- scaler.enabled=true
- scaler.min=1
- scaler.max=5
- scaler.metric=cpu
- scaler.up=80
- scaler.down=30
⚠️ Warning
Make sure Prometheus is scraping metrics from your Docker nodes (e.g., using cAdvisor).
The autoscaler only manages services with thescaler.enabled=truelabel and matchingSTACK_NAME.
For advanced scenarios, use thescaler.querylabel to provide a custom Prometheus query.
Content type
Image
Digest
sha256:7ca9ee965…
Size
54.6 MB
Last updated
7 months ago
docker pull vulcan99/autoscaler