Sign inSign up

dbohry/local-orquestrator

By dbohry

•Updated 11 days ago

Auto-scaler for Docker Swarm services

Image
Developer tools
0

936

dbohry/local-orquestrator repository overview

⁠Quick reference

⁠Local Orchestrator

Lightweight auto-scaler for Docker Swarm services. Monitors container CPU usage across cluster nodes and scales replicas up/down based on configurable thresholds.

⁠How it works

Runs as a single container on a Swarm manager node. Periodically collects CPU stats from all running tasks across the cluster, then adjusts replica counts for services that opt in via labels.

⁠Service Labels
LabelDefaultDescription
autoscaling—Set to true to enable auto-scaling
min-replicas1Minimum replica count
max-replicas5Maximum replica count
scale-up-cpu70CPU % threshold to add a replica
scale-down-cpu30CPU % threshold to remove a replica
⁠Environment Variables
VariableDefaultDescription
MANAGER_HOSTtcp://localhost:2375Docker manager API endpoint
DOCKER_API_PORT2375Port for worker node Docker APIs
FREQUENCY60000Evaluation interval in milliseconds
⁠Usage
services:
  orchestrator:
    image: dbohry/local-orquestrator
    environment:
      - MANAGER_HOST=tcp://manager:2375
      - FREQUENCY=30000
    deploy:
      placement:
        constraints:
          - node.role == manager

  my-app:
    image: my-app:latest
    deploy:
      labels:
        autoscaling: "true"
        min-replicas: "2"
        max-replicas: "10"
        scale-up-cpu: "80"
        scale-down-cpu: "20"
      replicas: 2
⁠Requirements
  • Docker Swarm mode
  • Docker API exposed on worker nodes (port 2375 by default)
⁠Resource Footprint

Runs with -Xmx32m — designed for always-on operation with minimal overhead.

Tag summary

Content type

Image

Digest

sha256:ba0fda5cb…

Size

37.3 MB

Last updated

11 days ago

docker pull dbohry/local-orquestrator