Commit Graph

33 Commits

Author SHA1 Message Date
Aaron Lehmann b6943c50f1 cluster: Do not autodetect advertise address on join
On join, remote addresses are supposed to be detected by the manager
that receives the join request. However, the daemon is interfering with
this by automatically detecting an advertise address and specifying that
to the remote manager. Fix this so that an advertise address is only
specified while joining a cluster if one was given by the user.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit b1d2b088533187954d3b98ed5951ec2dbbb422e9)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 21:02:54 -07:00
Jana Radhakrishnan df3209b4d6 Add GetListenAddress in ClusterProvider
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-23 17:30:36 -07:00
Diogo Monica caaf53ad3e Add --force to node removal
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
(cherry picked from commit a327c231b5c68c13b7dcde2fdc83b8e4cec59c43)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:45 -07:00
Sebastiaan van Stijn 798e0b07cb Update usage of "Swarm" for consistency
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f0230049f0afd318217c60ebe486aab3b54538fd)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:43 -07:00
Aaron Lehmann d8f3b3f006 Remove join-tokens from the /info API
join-tokens are not needed for this endpoint, and should not be as part
of /info

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-27 12:10:49 -07:00
Vincent Demeester a91bc28e62 Remove swarm inspect and use info instead
Remove the swarm inspect command and use docker info instead to display
swarm information if the current node is a manager.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit e6923f6d75c2bd1b22cc1229214ffceca3251cc6)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 04:37:31 -07:00
Madhu Venugopal 678a19ef6b improve error message when using ineligible network with service create
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 40c88b8c54fe4595f8bda5417ced3729eea5b16e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:27:41 -07:00
Aaron Lehmann 762a73bf7f Split advertised address from listen address
There are currently problems with "swarm init" and "swarm join" when an
explicit --listen-addr flag is not provided. swarmkit defaults to
finding the IP address associated with the default route, and in cloud
setups this is often the wrong choice.

Introduce a notion of "advertised address", with the client flag
--advertise-addr, and the daemon flag --swarm-default-advertise-addr to
provide a default. The default listening address is now 0.0.0.0, but a
valid advertised address must be detected or specified.

If no explicit advertised address is specified, error out if there is
more than one usable candidate IP address on the system. This requires a
user to explicitly choose instead of letting swarmkit make the wrong
choice. For the purposes of this autodetection, we ignore certain
interfaces that are unlikely to be relevant (currently docker*).

The user is also required to choose a listen address on swarm init if
they specify an explicit advertise address that is a hostname or an IP
address that's not local to the system. This is a requirement for
overlay networking.

Also support specifying interface names to --listen-addr,
--advertise-addr, and the daemon flag --swarm-default-advertise-addr.
This will fail if the interface has multiple IP addresses (unless it has
a single IPv4 address and a single IPv6 address - then we resolve the
tie in favor of IPv4).

This change also exposes the node's externally-reachable address in
docker info, as requested by #24017.

Make corresponding API and CLI docs changes.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit a0ccd0d42fdb0dd2005f67604cb81a5a6b26787e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:03 -07:00
Yong Tang c6cd4b37c7 Update the errNoManager() to conform to `swarm join-token`
In 24823, `swarm join` has been updated to take a `--token`
flag and flag `--manager` has been removed. Though in errNoManager()
the error message still use the old description.

This fix update the error message in errNoManager() and conforms
to the current available flags.

This fix is related to 24823.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 3d30155735d572376500729496de657459493213)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:01 -07:00
Aaron Lehmann 5d7a3f7b5f Replace secrets with join tokens
Implement the proposal from
https://github.com/docker/docker/issues/24430#issuecomment-233100121

Removes acceptance policy and secret in favor of an automatically
generated join token that combines the secret, CA hash, and
manager/worker role into a single opaque string.

Adds a docker swarm join-token subcommand to inspect and rotate the
tokens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 2cc5bd33eef038bf5721582e2410ba459bb656e9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:59 -07:00
Tonis Tiigi abf9cfe22f Increase timeout for swarm requests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 85b1fdf15ce2ad1b373748554d3aa218e2eb5a5f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:24 -07:00
Ralf Sippl 18f1fc8349 Return an empty services list if no services are running
Signed-off-by: Ralf Sippl <ralf.sippl@gmail.com>
(cherry picked from commit c8e4e95db9b0d3115435b8f0e94c78a2e0cb92d0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:36 -07:00
Madhu Venugopal e7dd82fab0 swarmkit expects network-id for as target
For any operation that involves netwoks (other than network create),
swarmkit expects the target as network-id. Service upate was using
network-name as the target and that caused the issue.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit b32cfb32a3f654f27bc9d4356b36c6a7e5e53b21)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:39 -07:00
Anil Madhavapeddy b18cea6d0f Improve the warning messages when leaving a Swarm cluster
Signed-off-by: Anil Madhavapeddy <anil@docker.com>
(cherry picked from commit 22a3d1fa209282e938ca16f31cce0dab4f35bf72)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:22 -07:00
Vincent Demeester bbc85af0bd Allow service and node filter to be name…
… on `docker node tasks` and `docker service tasks` commands.
This changes is mainly server-side (between engine api and
swarmkit). There is just a check in `api/client/service/tasks.go` to
handle the special *self* meaning.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit b0fc5a21f1138f48e0431a550c936e8908d72840)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:15 -07:00
Otto Kekäläinen 664c75ebba Fix spelling in comments, strings and documentation
Signed-off-by: Otto Kekäläinen <otto@seravo.fi>
(cherry picked from commit 644a7426cc31c338fedb6574d2b88d1cc2f43a08)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:42 -07:00
Nishant Totla ae47b00c6c Adding a flag to specify sending of registry auth
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit 538bac39d7fe93562922b89e9a294096be48fb59)
2016-07-01 00:40:31 -07:00
Nishant Totla c5ddd5bb7f Passing registry auth token for service create and update
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit 93ec5cda55e78dbb683b59bde244a7984b323574)
2016-07-01 00:39:51 -07:00
Tonis Tiigi 1f4e2f33ef Fix race on clearing swarm nodes on stop
On stop there were multiple places that marked
`cluster.node` nil. Now stop waits for the node to
set itself nil.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 1a8a473017299c5e999d55d14634874826062fce)
2016-06-30 16:57:31 -07:00
allencloud f463560ead fix error message and typos in swarm cluster
Signed-off-by: allencloud <allen.sun@daocloud.io>

(cherry picked from commit 39bc10c36d40677c11a800b4346c5cddec2b997d)
2016-06-30 16:47:49 -07:00
Tonis Tiigi 1fdce39622 Add better error messages for unavailable swarm commands
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 803733120a1f9f080c6403f2a3717987393f1f0d)
2016-06-30 16:47:48 -07:00
Tonis Tiigi 3d06cd4910 Unify swarm init and update options
Add api side validation and defaults for init and
join requests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit fb3eb1c27ef5520571c599ead8a72b343748db39)
2016-06-30 16:47:44 -07:00
Tonis Tiigi 8a994d4724 Don’t try to restore swarm from incomplete state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit ded1d9af38cb467dadab0521936174eef0d4bc9e)
2016-06-30 16:47:37 -07:00
Tonis Tiigi efc10a92ef Fix removing containers on leaving from pending state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 826f6f07031abc4dea6f71ed69d33a4e0789ee11)
2016-06-16 23:36:58 -07:00
Tonis Tiigi 0cac3c4c23 Return membership status on join without timeout
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 1973cee0cd86da3c7b7002a3fed7af2557df538c)
2016-06-16 23:36:57 -07:00
Tonis Tiigi 01c5b208e8 Update daemon to new swarmkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit a83bba467a8bd24924b1a0cf55b954ac49937b5b)
2016-06-16 23:36:57 -07:00
Victor Vieux 7cc76facba fix docker swarm init/update --secret
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit 085895342c7f797f0eef7ec956438e33489f211f)
2016-06-16 23:36:54 -07:00
Madhu Venugopal 60a86590aa Use service alias and configure container's --net-alias
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 07e39e9e7283a159efa18bc8f72cb2dc0e4f700f)
2016-06-16 23:36:51 -07:00
Arnaud Porterie 91197953d0 Merge pull request #23524 from aboch/restore
Daemon to support network restore
2016-06-15 02:33:16 +00:00
Tonis Tiigi 25a89d73e5 Update daemon to new swarmkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-14 17:23:35 -07:00
Lei Jitang ecffb6d58c Daemon to support network restore
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-06-14 16:45:25 -07:00
Tonis Tiigi 499e3a45b1 Increase the join connect timeout
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-14 10:20:47 -07:00
Tonis Tiigi 534a90a993 Add Swarm management backend
As described in our ROADMAP.md, introduce new Swarm management API
endpoints relying on swarmkit to deploy services. It currently vendors
docker/engine-api changes.

This PR is fully backward compatible (joining a Swarm is an optional
feature of the Engine, and existing commands are not impacted).

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-06-13 22:16:18 -07:00