orbiter/contrib/swarm
Gianluca Arbezzano 919e3bafba
Added swarm demo
This PR adds a demo with docker swarm and docker-machine.
2017-08-08 20:45:05 +02:00
..
cluster Added swarm demo 2017-08-08 20:45:05 +02:00
Makefile Added swarm demo 2017-08-08 20:45:05 +02:00
README.md Added swarm demo 2017-08-08 20:45:05 +02:00
stack.yml Added swarm demo 2017-08-08 20:45:05 +02:00

This is a tutorial to use orbiter as autoscaler with Docker Swarm.

Requirements:

  • Docker CLI installed
  • Docker Machine
  • Virtualbox
  1. Create a swarm cluster with 4 nodes. One manager and three workers. It uses Docker Machine and Virtualbox as provider.
make init
  1. Point Docker CLI to the right Docker machine. The master is called sw1.
eval $(docker-machine env sw1)
  1. Deploy your stack. The stack contains two services, one called orbiter and another called micro. Micro is the web app that we are autoscaling.
make deploy
  1. This command shows the current situation. The first table represent the number of services and how many task are running under a service. You should see two services. Micro has 10 tasks.
make ps
  1. There is an utility in the makefile to scale up and down micro.
make scale-up
make scale-down
  1. You can check the number of tasks changing every time you scale with the command:
make ps
  1. At the end of the test you can clean your envrionment
make destroy

That's it. Have a look at the code in ./stack.yml and Makefile to have more information about how orbiter works.