swarmexec executes command in swarm service
pip install git+https://github.com/filimon43g/swarmexec.git
In swarm_config.ini map your node host names with public hostnames or nodes IPs if neccessery.
ssh [email protected]
mkdir .ssh
echo "YOUR PUB SSH KEY" > .ssh/authorized_keys
chmod 700 .ssh
chmod 600 .ssh/authorized_keys
sudo gpasswd -a username docker
How to create ssh keys http://linuxproblem.org/art_9.html
export DOCKER_HOST=ssh://<manager node hostname>
swarmexec <service_name> <command>
or
swarmexec -H username@<manager node hostname> <command>
swarmexec -H [email protected] nginx_proxy ls -l /
swarmexec -H [email protected] nginx_proxy bash