Improve swarm join-token instructions
this change improves the instructions for
swarm join-token and swarm init;
- only print the join-token command for workers
instead of for both managers and workers, to
prevent users from copying the wrong command.
An extra line is added to explain how to obtain
the manager token.
- print a message that a token was rotated
sucesfully if '--rotate' is used.
- add some extra white-space before / after
the join commands, to make copy/pasting
easier.
this change also does some refactoring of join-token;
- move flagname-constants together with other constants
- use variables for selected role ("worker" / "manager")
to prevent checking for them multiple times, and to
keep the "worker" / "manager" sting centralized
- add an extra blank line after "join-token" instructions
this makes it easier to copy, and cleans up the
code a tiny bit
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ebebd4176940bc907ba4e8f5fbe62f6a050f8ed4
Component: engine
This commit is contained in:
@ -35,14 +35,12 @@ $ docker swarm init --advertise-addr 192.168.99.121
|
||||
Swarm initialized: current node (bvz81updecsj6wjz393c09vti) is now a manager.
|
||||
|
||||
To add a worker to this swarm, run the following command:
|
||||
|
||||
docker swarm join \
|
||||
--token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx \
|
||||
172.17.0.2:2377
|
||||
|
||||
To add a manager to this swarm, run the following command:
|
||||
docker swarm join \
|
||||
--token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2 \
|
||||
172.17.0.2:2377
|
||||
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
|
||||
```
|
||||
|
||||
`docker swarm init` generates two random tokens, a worker token and a manager token. When you join
|
||||
|
||||
@ -36,12 +36,14 @@ the swarm:
|
||||
```bash
|
||||
$ 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
|
||||
@ -51,7 +53,10 @@ Use the `--rotate` flag to generate a new join token for the specified role:
|
||||
|
||||
```bash
|
||||
$ docker swarm join-token --rotate worker
|
||||
Succesfully 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
|
||||
@ -63,6 +68,7 @@ The `-q` (or `--quiet`) flag only prints the token:
|
||||
|
||||
```bash
|
||||
$ docker swarm join-token -q worker
|
||||
|
||||
SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-b30ljddcqhef9b9v4rs7mel7t
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user