Scripts to create and manage a Docker Swarm cluster on Google Cloud Platform.
-
Make sure you create a Google Cloud Project
-
You need to enable Google Cloud Deployment Manager V2 API using this link.
Login:
gcloud init
./swarm-up.sh
By default, this will create a cluster with one manager and two workers. You can edit this and more options in the options.yaml file.
./swarm-down.sh
./swarm-resize.sh <NUM_WORKERS>
Edit the options.yaml file to specify your options.
- Cluster Configuration Options
prefix
= All nodes in the Swarm will start with this Prefix. This allows you to have multiple Swarms in the same project.zone
= Google Cloud Zone for the nodes - default: us-central1-f
- Manager Options
manager_machine_type
= Google Cloud Machine Type for the Manager nodes - default: n1-standard-1manager_disk
= Disk size in GB for the Manager nodes - default: 100
- Worker Options
num
= Number of Workers for the Cluster - default: 2worker_machine_type
= Google Cloud Machine Type for the Worker nodes - default: n1-standard-1worker_disk
= Disk size in GB for the Worker nodes - default: 100
These scripts are simple wrappers around a set of Deployment Manager templates.
It launches a VM for the Swarm Manager, and a Managed Instance Group for the workers.
This allows you to dynamically scale the number of workers as well as easily create Network Load Balancers that target the worker nodes.
Docker-Machine is used to connect to the Manager node over a secure TLS connection
- This is not an official Google product
- This is not an official Docker product
- Only tested on OSX