Skip to content

Instantly share code, notes, and snippets.

@nicosingh
Created November 27, 2018 20:47
Show Gist options
  • Save nicosingh/f67172bd618a58d6a9eb266e242fc13e to your computer and use it in GitHub Desktop.
Save nicosingh/f67172bd618a58d6a9eb266e242fc13e to your computer and use it in GitHub Desktop.
Docker swarm autoscaling using Orbiter PoC
version: "3.4"
services:
web:
image: nginx
ports:
- 80:80
deploy:
labels:
- "orbiter=true"
orbiter:
image: gianarb/orbiter
command: /bin/orbiter daemon --debug
ports:
- 8000:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
placement:
constraints:
- node.role == manager
mode: replicated
replicas: 1
# to start stack:
# docker stack deploy -c docker-compose.yml tranque
# to scale up:
# curl -X POST http://localhost:8000/v1/orbiter/handle/autoswarm/tranque_web/up
# to scale down:
# curl -X POST http://localhost:8000/v1/orbiter/handle/autoswarm/tranque_web/down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment