-
Notifications
You must be signed in to change notification settings - Fork 3
Description
The Bobber containers use SSH keys that are generated during the image build process to communicate for multi-node. This forces the user to build an image on one machine, save the image as a local tarball, then copy and load the saved image on all other machines to ensure they use the same SSH key to communicate seamlessly. Given the size of the Bobber images, this can be a long, tedious process.
I propose a new method which would make it possible to install the image on all machines and dynamically generate the SSH key that can be transferred to multiple machines. By creating a simple bash script that creates an SSH key at runtime, copies it to all hosts, then copies that key to all of the running Bobber containers, a single command (ie. bobber sync host1,host2,host3,...) could be run to support multi-node communication. The following rough pseudo-code is an example:
# Generate the key.
ssh-keygen -t rsa -f /tmp/bobber/id_rsa ...
# Loop over all hosts
for host in hosts; do
# Copy the key to the remote hosts. This will ask for the remote password.
scp /tmp/bobber/id_rsa* host:/tmp/bobber
# Copy the keys on each host to the Docker container. This will also ask for the remote password.
docker cp /tmp/bobber/id_rsa.pub bobber:/root/.ssh/id_rsa.pub
doneThe above example is by no means complete, but demonstrates the basic structure necessary to achieve the desired effect.