Skip to content

filimon43g/swarmexec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swarmexec

swarmexec executes command in swarm service

Install

pip install git+https://github.com/filimon43g/swarmexec.git

Config

On the local machine

In swarm_config.ini map your node host names with public hostnames or nodes IPs if neccessery. 

On all swarm nodes

Put ssh keys and add your user to the docker group

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

Usage

export DOCKER_HOST=ssh://<manager node hostname>
swarmexec <service_name> <command>

or

swarmexec -H username@<manager node hostname> <command>

Examples

swarmexec -H [email protected] nginx_proxy ls -l /
swarmexec -H [email protected] nginx_proxy bash

About

executes command in swarm service

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages