Answers: <p>Have the Swarm Manager place the worker join token in a Key/Value store.  We use AWS Parameter Store but I believe Consul would be another option (I don't use it).</p>
  
  <p>Each node can then retrieve the token while it is bootstrapping.</p>
  
Answers: CC BY-SA 3.0
Answers: 2018-01-26T07:21:16.280Z
Answers: what if you have more than 1 manager?
Answers: Ta Mu
Answers: CC BY-SA 3.0
Answers: 2018-01-26T13:05:54.563Z
Answers: The manager join token can be stored in a K/V store as well.  The initial manager token is the starting point for rebuilding or bootstrapping the Swarm.
Answers: swysocki
Answers: CC BY-SA 3.0
Answers: 2018-01-25T22:20:59.223Z
Answers: 2018-01-25T22:20:59.223Z
Answers: swysocki
Answers: <p>Simple answer with infrastructure as code, you don't rejoin nodes, you trash old nodes and bring fresh nodes to join the cluster. </p>
  
Answers: CC BY-SA 3.0
Answers: 2018-01-26T07:22:24.110Z
Answers: still you need to tell the new nodes as well how they join as worker either manager. Or do you mean once a token is there you bake it into their IaC?
Answers: Ta Mu
Answers: CC BY-SA 3.0
Answers: 2018-01-26T08:36:08.040Z
Answers: I just mean same principle as building a new cluster, code your cluster building process and then when you want to reset, build a new and trash the old one. How you code this is fairly personal ...
Answers: Tensibai
Answers: CC BY-SA 3.0
Answers: 2018-01-25T21:26:19.067Z
Answers: 2018-01-25T21:26:19.067Z
Answers: Tensibai
Body: <p>Imagine you want to reset your Docker swarm from time to time. </p>
  
  <p>How do you distribute join tokens to those zillions of nodes? How much automation is possible here?</p>
  
Tags: <docker><automation><docker-swarm><distributed-systems>
Title: Automated Docker swarm reinitialization and token distribution
UserDisplayName: Ta Mu
ThreadText: # Automated Docker swarm reinitialization and token distribution
  
  (Asked by: username_0 on 2018-01-25)
  
  Imagine you want to reset your Docker swarm from time to time.
  
  How do you distribute join tokens to those zillions of nodes? How much automation is possible here?
  
  **Tags:** docker, automation, docker-swarm, distributed-systems
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-01-25. Score: 2
  
  Have the Swarm Manager place the worker join token in a Key/Value store. We use AWS Parameter Store but I believe Consul would be another option (I don't use it).
  
  Each node can then retrieve the token while it is bootstrapping.
  
  > **Comments:**
  > **username_0**: what if you have more than 1 manager?  
  > **username_1**: The manager join token can be stored in a K/V store as well.  The initial manager token is the starting point for rebuilding or bootstrapping the Swarm.  
  
  ---
  
  ### Answer by username_2 on 2018-01-25. Score: 1
  
  Simple answer with infrastructure as code, you don't rejoin nodes, you trash old nodes and bring fresh nodes to join the cluster.
  
  > **Comments:**
  > **username_0**: still you need to tell the new nodes as well how they join as worker either manager. Or do you mean once a token is there you bake it into their IaC?  
  > **username_2**: I just mean same principle as building a new cluster, code your cluster building process and then when you want to reset, build a new and trash the old one. How you code this is fairly personal ...  
  
  ---
  
  