slavamirovsky / swarm-mode

Create a docker swarm locally or on AWS with a compose V3 stack and scale it up

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prerequisites: docker-engine 1.13, bash, awscli (if you're spinning up aws docker-machines). Includes portainer for example web management of swarm and a run_machine script which runs a command on all docker-machines created from a host.

Example deployment of a docker-compose V3 stack onto a 1.13+ swarm

  1. build example stack: ./run-swarm.sh build

  2. run stack on swarm (ignore errors about pre-existing stacks): ./run-swarm.sh run

  3. After a few seconds, test service curl localhost:8080

  4. scale example service: ./run-swarm.sh scale

  5. remove stack from swarm: ./run-swarm.sh rm

To run this or your own example on an AWS EC2 Swarm using Docker-Machine:

  1. Edit your AWS credentials and desired EC2 configuration flags into scripts/swarm_setup.sh and make sure the awscli binary is setup for your aws account.

  2. Execute ./swarm_setup.sh to create a multi-host swarm cluster to your specification

  3. Access your manager node using docker-machine ssh <NODE_NAME>

  4. Copy the repo onto your swarm manager and execute ./run-swarm.sh run. The first node created will be the Swarm Manager.

About

Create a docker swarm locally or on AWS with a compose V3 stack and scale it up


Languages

Language:Shell 97.1%Language:Python 2.9%