Skip to content

Instantly share code, notes, and snippets.

@moul
Last active February 11, 2017 05:28
Show Gist options
  • Save moul/0e828ac35889aa31ac48de678d83ab0d to your computer and use it in GitHub Desktop.
Save moul/0e828ac35889aa31ac48de678d83ab0d to your computer and use it in GitHub Desktop.
scaleway + swarm + docker-machine
#!/bin/sh
export SCALEWAY_ORGANIZATION=XXX
export SCALEWAY_TOKEN=XXX
export SWARM_TOKEN=XXX
docker-machine create -d scaleway --swarm --scaleway-name=swarm-manager --swarm-master --swarm-discovery=token://$SWARM_TOKEN swarm-manager
for node in 1 2 3; do docker-machine create -d scaleway --swarm --scaleway-name=swarm-node-$node --swarm-discovery=token://$SWARM_TOKEN swarm-node-$node; done
eval "$(docker-machine env --swarm swarm-manager)"
docker info
$ export SCALEWAY_ORGANIZATION=XXX
$ export SCALEWAY_TOKEN=XXX
$ export SWARM_TOKEN=XXX
$ docker-machine create -d scaleway --swarm --scaleway-name=swarm-manager --swarm-master --swarm-discovery=token://$SWARM_TOKEN swarm-manager
Running pre-create checks...
Creating machine...
(swarm-manager) Creating SSH key...
(swarm-manager) Creating server...
(swarm-manager) Starting server...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(upstart)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Configuring swarm...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env swarm-manager
$ for node in 1 2 3; do docker-machine create -d scaleway --swarm --scaleway-name=swarm-node-$node --swarm-discovery=token://$SWARM_TOKEN swarm-node-$node; done
Running pre-create checks...
Creating machine...
(swarm-node-1) Creating SSH key...
(swarm-node-1) Creating server...
(swarm-node-1) Starting server...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(upstart)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Configuring swarm...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env swarm-node-1
Running pre-create checks...
Creating machine...
(swarm-node-2) Creating SSH key...
(swarm-node-2) Creating server...
(swarm-node-2) Starting server...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(upstart)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Configuring swarm...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env swarm-node-2
Running pre-create checks...
Creating machine...
(swarm-node-3) Creating SSH key...
(swarm-node-3) Creating server...
(swarm-node-3) Starting server...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(upstart)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Configuring swarm...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env swarm-node-3
$ eval "$(docker-machine env --swarm swarm-manager)"
$ docker info
Containers: 4
 Running: 4
 Paused: 0
 Stopped: 0
Images: 3
Server Version: swarm/1.2.0
Role: primary
Strategy: spread
Filters: health, port, dependency, affinity, constraint
Nodes: 3
 swarm-manager: 212.47.231.213:2376
  └ Status: Healthy
  └ Containers: 2
  └ Reserved CPUs: 0 / 2
  └ Reserved Memory: 0 B / 2.052 GiB
  └ Labels: executiondriver=, kernelversion=4.4.6-docker-5, operatingsystem=Ubuntu 14.04.4 LTS, provider=scaleway, storagedriver=aufs
  └ Error: (none)
  └ UpdatedAt: 2016-04-18T17:31:54Z
  └ ServerVersion: 1.11.0
 swarm-node-1: 212.47.227.79:2376
  └ Status: Healthy
  └ Containers: 1
  └ Reserved CPUs: 0 / 2
  └ Reserved Memory: 0 B / 2.052 GiB
  └ Labels: executiondriver=, kernelversion=4.4.6-docker-5, operatingsystem=Ubuntu 14.04.4 LTS, provider=scaleway, storagedriver=aufs
  └ Error: (none)
  └ UpdatedAt: 2016-04-18T17:31:50Z
  └ ServerVersion: 1.11.0
 swarm-node-2: 212.47.229.209:2376
  └ Status: Healthy
  └ Containers: 1
  └ Reserved CPUs: 0 / 2
  └ Reserved Memory: 0 B / 2.052 GiB
  └ Labels: executiondriver=, kernelversion=4.4.6-docker-5, operatingsystem=Ubuntu 14.04.4 LTS, provider=scaleway, storagedriver=aufs
  └ Error: (none)
  └ UpdatedAt: 2016-04-18T17:32:04Z
  └ ServerVersion: 1.11.0
 swarm-node-3: 212.47.229.210:2376
  └ Status: Healthy
  └ Containers: 1
  └ Reserved CPUs: 0 / 2
  └ Reserved Memory: 0 B / 2.052 GiB
  └ Labels: executiondriver=, kernelversion=4.4.6-docker-5, operatingsystem=Ubuntu 14.04.4 LTS, provider=scaleway, storagedriver=aufs
  └ Error: (none)
  └ UpdatedAt: 2016-04-18T17:38:04Z
  └ ServerVersion: 1.11.0
Plugins: 
 Volume: 
 Network: 
Kernel Version: 4.4.6-docker-5
Operating System: linux
Architecture: amd64
CPUs: 6
Total Memory: 6.157 GiB
Name: 818b23b366e5
Docker Root Dir: 
Debug mode (client): false
Debug mode (server): false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment