Docker Community Forums

Share and learn in the Docker community.

Swarm Mode with no internet connection

Hi
I have a raspberry pi cluster running docker in swarm mode, which I intend to use for a demo on my uni course. The uni does not allow internet connection to the pi’s so I need a way to set up the cluster so it will run without internet connection.
Is there a way of setting swarm mode so that it doesnot require internet connection.

thanks in advance

popeye

Hi

What problems are you having? Whats not working when you create the cluster?

The base hardware is a raspberry pi 3 with a clusterhat fitted to which are fitted 4 pi zero’s
The Pi 3 is connected to my local netwrok at home via my router which gives it (and the other pi zero’s) ip addresses.
I ran up docker swarm and add nodes no problem and can create services with no issue.
I have pulled all the imagaes down onto each pi so that they are all the same.
For my demo at uni, I cannot have an internet connection so have set up a router to give the pis there ipaddress via dhcp.
I then start the swarm as before.
The issue is: now i get an message saying no registery
and when I try to create a service nothing ever starts even though i have the images.
I have read that the deamon needs a discovery service which it gets via the internet, but i dont have net connection.
And i have no idea how to run one locally on a pi

Thanks for replying

“No internet connection” is a real life scenario for many.

  1. import the images you require on each node
  2. be patient when the stack and its service are deployed, as scheduling seem to take ages (even on way beefier machines) when the required registry is not available

Why not just run a registry on one of the PIs? Nexus3 has a build in registry and is easy to instanciate as a container…

Ok, after some more research based of meyay’s suggestions, i managed to get things up and running.
I downloaded all the relevant images to each pi (rather than do a local registery, although i will do this now i have more time). Then added a network overlay to the system giving the cluster its own subnet. I then attached each service to the new subnet and it worked.
Things to note.: i was using a clusterhat (which uses OTG network communication) which caused comms issues between the containers, it would appear that not all containers can cope with OTG coms.
Also the iptabel forwarding was a problem, every time i reset the master pi it did not forward the iptables on restart. I had to “sudo iptables -P FORWARD ACCEPT” on it after every restart. I didnt realise this, and was part of the none communication issue.

Cheers

jack