Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for executing one off commands on nodes #2007

Closed
g0t4 opened this issue Mar 5, 2017 · 1 comment
Closed

Support for executing one off commands on nodes #2007

g0t4 opened this issue Mar 5, 2017 · 1 comment

Comments

@g0t4
Copy link

g0t4 commented Mar 5, 2017

Consul has a convenient subcommand to execute a command on all nodes or a subset of nodes:
consul exec -node worker uptime. This command is propagated via gossip so there's no guarantee of execution. Nonetheless, this is great for one off troubleshooting and when learning, to execute commands across nodes.

See more details here: https://www.consul.io/docs/commands/exec.html

Perhaps we could have something like:

swarmctl node exec -f name=worker -c uptime
swarmctl node exec -f name=worker -c "docker image ls"

docker node exec -f name=worker -c uptime
docker node exec -f name=worker -c "docker image ls"

Think of this as syntactic sugar over using docker node ls -f worker and then ssh -c. Though, with docker node exec I wouldn't need to have direct SSH access to nodes.

@aluzzardi
Copy link
Member

Thanks for the suggestion @g0t4.

It's an interesting idea, however, we are not looking to implement it in the near future.

Something similar could be achieved with https://github.com/crosbymichael/slex and some bash around the docker CLI

/cc @crosbymichael

@g0t4 g0t4 closed this as completed Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants