diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join-token%2Findex.html | |
new repository
Diffstat (limited to 'devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join-token%2Findex.html')
| -rw-r--r-- | devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join-token%2Findex.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join-token%2Findex.html b/devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join-token%2Findex.html new file mode 100644 index 00000000..11c789c3 --- /dev/null +++ b/devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join-token%2Findex.html @@ -0,0 +1,36 @@ +<h1>docker swarm join-token</h1> <p><br></p> <p>Manage join tokens</p> <p><span class="badge badge-info" data-toggle="tooltip" data-placement="right" title="This command works with the Swarm orchestrator.">Swarm</span> This command works with the Swarm orchestrator.</p> <h2 id="usage">Usage</h2> <div class="highlight"><pre class="highlight" data-language="">$ docker swarm join-token [OPTIONS] (worker|manager) +</pre></div> <p>Refer to the <a href="#options">options section</a> for an overview of available <a href="#options"><code class="language-plaintext highlighter-rouge">OPTIONS</code></a> for this command.</p> <h2 id="description">Description</h2> <p name="extended-description">Join tokens are secrets that allow a node to join the swarm. There are two different join tokens available, one for the worker role and one for the manager role. You pass the token using the <code class="language-plaintext highlighter-rouge">--token</code> flag when you run <a href="../swarm_join/index">swarm join</a>. Nodes use the join token only when they join the swarm.</p> <blockquote> <p><strong>Note</strong></p> <p>This is a cluster management command, and must be executed on a swarm manager node. To learn about managers and workers, refer to the <a href="../../../swarm/index">Swarm mode section</a> in the documentation.</p> </blockquote> <p>For example uses of this command, refer to the <a href="#examples">examples section</a> below.</p> <h2 id="options">Options</h2> <table> <thead> <tr> <td>Name, shorthand</td> <td>Default</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td> +<code class="language-plaintext highlighter-rouge">--quiet</code> , <code class="language-plaintext highlighter-rouge">-q</code> +</td> <td></td> <td>Only display token</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--rotate</code></td> <td></td> <td>Rotate join token</td> </tr> </tbody> </table> <h2 id="examples">Examples</h2> <p>You can view or rotate the join tokens using <code class="language-plaintext highlighter-rouge">swarm join-token</code>.</p> <p>As a convenience, you can pass <code class="language-plaintext highlighter-rouge">worker</code> or <code class="language-plaintext highlighter-rouge">manager</code> as an argument to <code class="language-plaintext highlighter-rouge">join-token</code> to print the full <code class="language-plaintext highlighter-rouge">docker swarm join</code> command to join a new node to the swarm:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker swarm join-token worker + +To add a worker to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx \ + 172.17.0.2:2377 + +$ docker swarm join-token manager + +To add a manager to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2 \ + 172.17.0.2:2377 +</pre></div> <p>Use the <code class="language-plaintext highlighter-rouge">--rotate</code> flag to generate a new join token for the specified role:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker swarm join-token --rotate worker + +Successfully rotated worker join token. + +To add a worker to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-b30ljddcqhef9b9v4rs7mel7t \ + 172.17.0.2:2377 +</pre></div> <p>After using <code class="language-plaintext highlighter-rouge">--rotate</code>, only the new token will be valid for joining with the specified role.</p> <p>The <code class="language-plaintext highlighter-rouge">-q</code> (or <code class="language-plaintext highlighter-rouge">--quiet</code>) flag only prints the token:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker swarm join-token -q worker + +SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-b30ljddcqhef9b9v4rs7mel7t +</pre></div> <h3 id="--rotate"><code class="language-plaintext highlighter-rouge">--rotate</code></h3> <p>Because tokens allow new nodes to join the swarm, you should keep them secret. Be particularly careful with manager tokens since they allow new manager nodes to join the swarm. A rogue manager has the potential to disrupt the operation of your swarm.</p> <p>Rotate your swarm’s join token if a token gets checked-in to version control, stolen, or a node is compromised. You may also want to periodically rotate the token to ensure any unknown token leaks do not allow a rogue node to join the swarm.</p> <p>To rotate the join token and print the newly generated token, run <code class="language-plaintext highlighter-rouge">docker swarm join-token --rotate</code> and pass the role: <code class="language-plaintext highlighter-rouge">manager</code> or <code class="language-plaintext highlighter-rouge">worker</code>.</p> <p>Rotating a join-token means that no new nodes will be able to join the swarm using the old token. Rotation does not affect existing nodes in the swarm because the join token is only used for authorizing new nodes joining the swarm.</p> <h3 id="--quiet"><code class="language-plaintext highlighter-rouge">--quiet</code></h3> <p>Only print the token. Do not print a complete command for joining.</p> <h2 id="parent-command">Parent command</h2> <table> <thead> <tr> <th style="text-align: left">Command</th> <th style="text-align: left">Description</th> </tr> </thead> <tbody> <tr> <td style="text-align: left"><a href="../swarm/index">docker swarm</a></td> <td style="text-align: left">Manage Swarm</td> </tr> </tbody> </table> <h2 id="related-commands">Related commands</h2> <table> <thead> <tr> <td>Command</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td><a href="../swarm_ca/index">docker swarm ca</a></td> <td>Display and rotate the root CA</td> </tr> <tr> <td><a href="../swarm_init/index">docker swarm init</a></td> <td>Initialize a swarm</td> </tr> <tr> <td><a href="../swarm_join/index">docker swarm join</a></td> <td>Join a swarm as a node and/or manager</td> </tr> <tr> <td><a href="index">docker swarm join-token</a></td> <td>Manage join tokens</td> </tr> <tr> <td><a href="../swarm_leave/index">docker swarm leave</a></td> <td>Leave the swarm</td> </tr> <tr> <td><a href="../swarm_unlock/index">docker swarm unlock</a></td> <td>Unlock swarm</td> </tr> <tr> <td><a href="../swarm_unlock-key/index">docker swarm unlock-key</a></td> <td>Manage the unlock key</td> </tr> <tr> <td><a href="../swarm_update/index">docker swarm update</a></td> <td>Update the swarm</td> </tr> </tbody> </table> <div class="_attribution"> + <p class="_attribution-p"> + © 2019 Docker, Inc.<br>Licensed under the Apache License, Version 2.0.<br>Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.<br>Docker, Inc. and other parties may also have trademark rights in other terms used herein.<br> + <a href="https://docs.docker.com/engine/reference/commandline/swarm_join-token/" class="_attribution-link">https://docs.docker.com/engine/reference/commandline/swarm_join-token/</a> + </p> +</div> |
