Fix potential ip overlap with node LB (method 2)#41062
Fix potential ip overlap with node LB (method 2)#41062xinfengliu wants to merge 3 commits intomoby:masterfrom
Conversation
add test cases for verifying node LB removal under some conditions. Also add: - `ServiceWithRestartAttempts` and `ServiceWithHealthCheck` for service creation in tests. - Waiting conditions for `CompletedTasksCount` and `FailedTasksCount` Signed-off-by: Xinfeng Liu <xinfeng.liu@gmail.com>
Add network removal code to `tryDetachContainerFromClusterNetwork()` in `daemon/container_operations.go` to make sure network removal on overlay nework is called when container exits. Also for swarmkit controller, we don't have to worry network removal in task shutdown. Add task shutdown codes in a few other places where task container should not continue to run. Signed-off-by: Xinfeng Liu <xinfeng.liu@gmail.com>
51c4cb3 to
be1b80b
Compare
|
To be more specific about the ideas of this PR: |
7d8d229 to
4a015ff
Compare
4a015ff to
94183d5
Compare
Further optimize fix potential IP overlap with node LB (method 2). - Refactor test codes - Add testServiceInvalidMount - No need to run removeNetworks() when task container startup failure. - Add removeNetworks() in Prepare() of daemon/cluster/executor/container/controller.go. - Bring over moby#41011 to make a integrated fix. Signed-off-by: Xinfeng Liu <xinfeng.liu@gmail.com>
94183d5 to
7100de3
Compare
|
Will be this patch backported to 19.03? |
|
@dperny PTAL? |
|
@xinfengliu @thaJeztah any updates? |
|
@xinfengliu making |
|
Ah, sorry, wanted to comment as well; we went over this (and the other PR) in a maintainers meeting two weeks ago, and there definitely were concerns with the change (at least it was considered "risky" for a patch release). We discussed that, yes, there is something to solve, but unsure what the best approach was. To add to that; it's a complicated flow of events (combination of "non-managed" (regular) containers, "managed" / swarmkit containers, which made it difficult to review and with certainty determine the impact (and possible risks that were overlooked). Perhaps we need a separate call/meeting to go through the changes (and issues). Something like a (simple) "flow chart" of events that happen and impact the problem could help (at least from my side to "visualise" what's happening). Ideally, "domain experts" should be in that call (@dperny @xinfengliu @arkodg) |
|
@thaJeztah @xinfengliu any updates? Without this fix we have 2-3 failed deploys caused by overlaped IP addresses. |
|
Hi @mightydok , As @thaJeztah mentioned at earlier time, the project maintainers had some concerns about this PR. In fact, I'm not the original author of those docker components I made the modifications to, so I'm not sure if this PR is 100% safe. I guess @thaJeztah is looking for the best and the safest approach to address this issue. IMHO, It's best that the original authors of related components can help on this. |
|
@xinfengliu thnx for info @thaJeztah what the next steps for this issue? How we can help with it? |
Fixes #40989
Signed-off-by: Xinfeng Liu xinfeng.liu@gmail.com
- What I did
Call network removal for overlay network on container exit.
- How I did it
Add network removal code to
tryDetachContainerFromClusterNetwork()indaemon/container_operations.goto make sure network removal on overlaynework is called when container exits. Also for swarmkit controller, we don't have to worry network removal in task shutdown.
Add network removal for task container startup failure.Update: when task container fails to startup, the
CleanUp()indaemon/start.gowill also be called, so the network removal will be called too.Add task shutdown codes in a few other places where task container should not continue to run.
Add
removeNetworks()inPrepare()ofdaemon/cluster/executor/container/controller.go.Bring over PR 41011 to make an integrated fix.
- How to verify it
Added test cases in CI.
- Description for the changelog
Fix potential IP overlapping with node LB when container exits itself or container creation/startup fails.
- A picture of a cute animal (not mandatory but encouraged)