Docker swarm manager, enable autoscaling and more
479

Swarm Pilot is a Docker Swarm cluster management tool designed to simplify and automate the scaling of services based on resource usage. It monitors CPU and memory usage across your services and dynamically adjusts the number of replicas to ensure optimal performance and resource utilization.
Below is an example deployment configuration for Swarm Pilot using a docker-compose.yml file:
services:
swarm-pilot:
image: gradlon/swarm-pilot:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- DEBUG=false
- PROM_HOST=prometheus.int.integral-systems.ch
- PROM_USER=${PROM_USER}
- PROM_PASS=${PROM_PASS}
- PROM_PORT=443
- PROM_SCHEMA=https
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID}
- BATCH_SIZE=5
- AUTOSCALER_INTERVAL=${AUTOSCALER_INTERVAL:-5}
- ENABLE_AUTOSCALER_LABEL=swarm.autoscaler
- AUTOSCALER_MINIMUM_CPU_LABEL=swarm.autoscaler.minimum_cpu
- AUTOSCALER_CPU_MINIMUM_DEFAULT=${AUTOSCALER_CPU_MINIMUM:-25}
- AUTOSCALER_MAXIMUM_CPU_LABEL=swarm.autoscaler.maximum_cpu
- AUTOSCALER_MAXIMUM_CPU_DEFAULT=${AUTOSCALER_CPU_MAXIMUM:-85}
- AUTOSCALER_MINIMUM_MEM_LABEL=swarm.autoscaler.minimum_mem
- AUTOSCALER_MEM_MINIMUM_DEFAULT=${AUTOSCALER_MEM_MINIMUM:-25}
- AUTOSCALER_MAXIMUM_MEM_LABEL=swarm.autoscaler.maximum_mem
- AUTOSCALER_MAXIMUM_MEM_DEFAULT=${AUTOSCALER_MEM_MAXIMUM:-85}
- AUTOSCALER_MIN_REPLICAS_LABEL=swarm.autoscaler.min_replicas
- AUTOSCALER_MIN_REPLICAS_DEFAULT=1
- AUTOSCALER_MAX_REPLICAS_LABEL=swarm.autoscaler.max_replicas
- AUTOSCALER_MAX_REPLICAS_DEFAULT=10
networks:
- default
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
resources:
limits:
cpus: '0.10'
memory: 128M
reservations:
cpus: '0.10'
memory: 64M
To deploy this configuration, save it to a file named docker-compose.yml and run:
docker stack deploy -c docker-compose.yml swarm-manager
- **Node Rebalancing**: Automatically redistribute services across nodes to ensure even resource utilization and reduce bottlenecks.
- **Node Scaling/Provisioning/Decommissioning (Hetzner)**: Dynamically add or remove nodes in the cluster based on workload demands, leveraging Hetzner's infrastructure.
Content type
Image
Digest
sha256:34a589f4b…
Size
308.5 MB
Last updated
over 1 year ago
docker pull gradlon/swarm-pilot