Fix static IP collisions across swarm nodes#54
Merged
Conversation
dfc897b to
6cc0598
Compare
6cc0598 to
5e8b3c3
Compare
NetworkInspect on overlay networks only returns local containers, so nodes couldn't see IPs already assigned on other nodes. All nodes picked the same high IPs (.253, .252, etc.) causing "attaching to network failed: context deadline exceeded" on ContainerStart. Fix: derive a per-node index via NodeList (managers) or FNV hash of the node ID (workers), then offset each node's IP block by nodeIndex * numContainers so every node picks distinct IPs. Also skip static IP assignment on the default bridge network, which rejects user-specified IPs.
5e8b3c3 to
2cdd579
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NodeList(managers) or FNV hash of node ID (workers), then offset each node's IP block bynodeIndex * numContainersso every swarm node picks distinct IPsRoot cause
NetworkInspecton overlay networks only returns containers on the local node. So all nodes picked the same IPs (.253, .252, etc.) causing IP conflicts andcontext deadline exceededonContainerStart.Evidence