1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon/cluster
Drew Erny 89edb68e89
Fix possible overlapping IPs
A node is no longer using its load balancer IP address when it no longer
has tasks that use the network that requires that load balancer. When
this occurs, the swarmkit manager will free that IP in IPAM, and may
reaassign it.

When a task shuts down cleanly, it attempts removal of the networks it
uses, and if it is the last task using those networks, this removal
succeeds, and the load balancer IP is freed.

However, this behavior is absent if the container fails. Removal of the
networks is never attempted.

To address this issue, I amend the executor. Whenever a node load
balancer IP is removed or changed, that information is passedd to the
executor by way of the Configure method. By keeping track of the set of
node NetworkAttachments from the previous call to Configure, we can
determine which, if any, have been removed or changed.

At first, this seems to create a race, by which a task can be attempting
to start and the network is removed right out from under it. However,
this is already addressed in the controller. The controller will attempt
to recreate missing networks before starting a task.

Signed-off-by: Drew Erny <derny@mirantis.com>
(cherry picked from commit 0d9b0ed678)
Signed-off-by: Ameya Gawde <agawde@mirantis.com>
2021-06-18 10:13:59 -07:00
..
controllers/plugin cluster/controllers/plugin: remove unused Controller.taskID (unused) 2019-09-18 12:57:49 +02:00
convert Fix jobs-related bug in task conversion 2020-12-02 12:27:23 -06:00
executor Fix possible overlapping IPs 2021-06-18 10:13:59 -07:00
provider Add canonical import comment 2018-02-05 16:51:57 -05:00
cluster.go Replace errors.Cause() with errors.Is() / errors.As() 2020-04-29 00:28:41 +02:00
configs.go set bigger grpc limit for GetConfigs api 2019-02-26 11:09:25 -05:00
errors.go Add canonical import comment 2018-02-05 16:51:57 -05:00
filters.go Changes to cluster/filter, swagger.yaml, version-history.md for filtering on node labels. 2018-08-21 22:17:23 +02:00
filters_test.go Add canonical import comment 2018-02-05 16:51:57 -05:00
helpers.go Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
listen_addr.go daemon/cluster: normalize comment formatting 2019-11-27 15:42:53 +01:00
listen_addr_linux.go Add canonical import comment 2018-02-05 16:51:57 -05:00
listen_addr_others.go Add canonical import comment 2018-02-05 16:51:57 -05:00
networks.go Move network conversions out of API router 2018-06-27 17:11:29 -07:00
noderunner.go Replace errors.Cause() with errors.Is() / errors.As() 2020-04-29 00:28:41 +02:00
nodes.go daemon/cluster: fix unused context (staticcheck) 2019-09-18 12:55:42 +02:00
secrets.go Increase max recv gRPC message size for nodes and secrets 2019-06-03 11:42:31 -05:00
services.go Fix jobs mode filter spelling 2020-12-15 14:45:05 -06:00
swarm.go Replace errors.Cause() with errors.Is() / errors.As() 2020-04-29 00:28:41 +02:00
tasks.go cluster: set bigger grpc limit for array requests 2018-10-30 16:02:34 -07:00
utils.go Add canonical import comment 2018-02-05 16:51:57 -05:00