Skip to content

Docker swarm join #1502

Answered by till
Theni224 asked this question in Q&A
Jul 27, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

So you either run something like Ansible outside the nodes or inspect the response from the join command? I don't know how granular it is since the node could be already joined, there could be transport errors and the token could be expired.

But maybe that gives you a hint as to if the node has joined.

I am still using Ansible for this part - basically do a docker node ls, parse and add/remove workers with a dynamic inventory.

I guess the systemd way would be to set a pre condition in the unit, e.g. a file shouldn't exist and then you execute the join command and create the file.

But I find that hacky and also leaves questions open for a DR (when managers break).

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@till
Comment options

@Theni224
Comment options

@till
Comment options

Answer selected by Theni224
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants