scaleway / docker-machine-driver-scaleway

:whale: Scaleway driver for Docker Machine
MIT License
248 stars 34 forks source link

Update cluster example for Swarm Mode #57

Open alexellis opened 8 years ago

alexellis commented 8 years ago

The Swarm example doesn't seem to support "Swarm Mode":

https://github.com/scaleway/docker-machine-driver-scaleway/blob/master/examples/start-swarm-cluster.sh

Would you be able to update it? Does the driver already support the new mode?

Alex

pascalandy commented 7 years ago

I could not create a cluster with public adresses but it's working using private adresses.

Using the CLI and docker-machine for scw it's solid. Here is how I do it:

docker-machine create -d scaleway \
--scaleway-region="par1" \
--scaleway-image="3803a8a7" \
--scaleway-token="123123123" \
--scaleway-organization="123123123" \
--scaleway-commercial-type="VC1S" \
--swarm \
--scaleway-name="N01-PAR1" N01-PAR1

3803a8a7 is the docker image

It's good to know the second name is used by the docker-machine driver.

pascalandy commented 7 years ago

Actually, more I'm thinking about it ...

We don't need --swarm as it makes more sense to go with the Docker Swarm Mode.


Create your nodes and then run this on your manager:

# scaleway (private address)
IP_N01=$(ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1)
echo "On the manager run: docker swarm init --advertise-addr=$IP_N01"
pascalandy commented 7 years ago

@alexellis I don't think it's docker-machine's job to create a cluster.

chokosabe commented 7 years ago

The script above no longer seems to work; quite a few fails throughout:

sh start-swarm-cluster.sh

Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Error creating machine: Error running provisioning: ssh command error: command : sudo systemctl -f start docker err : exit status 1 output : Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

gardner commented 7 years ago

The docs are for pre docker engine 1.12. As of 1.12 docker swarm behaves differently and does not appear to require an external service like consul or etcd to manage distributed configurations.