Created
October 29, 2019 12:49
-
-
Save kokigit/19baa042d0745bcda6c3f96fb7a75904 to your computer and use it in GitHub Desktop.
How to know service is running on which node in swarm?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for ITR in $(docker stack ps dockerstack --no-resolve --format '{{.Node}}={{.Image}}'); do echo -e "$(cut -d'=' -f2 <<< ${ITR})" - $(docker node inspect --format '{{.Status.Addr}}' "$(cut -d'=' -f1 <<< ${ITR})"); done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in the example docker stack name is "dockerstack"