Skip to content

Fix static IP collisions across swarm nodes#54

Merged
firecow merged 1 commit intomainfrom
fix/skip-static-ip-on-overlay-and-default-bridge
Feb 12, 2026
Merged

Fix static IP collisions across swarm nodes#54
firecow merged 1 commit intomainfrom
fix/skip-static-ip-on-overlay-and-default-bridge

Conversation

@firecow
Copy link
Copy Markdown
Member

@firecow firecow commented Feb 12, 2026

Summary

  • Derive a per-node index via NodeList (managers) or FNV hash of node ID (workers), then offset each node's IP block by nodeIndex * numContainers so every swarm node picks distinct IPs
  • Skip static IP assignment on the default bridge network (rejects user-specified IPs)

Root cause

NetworkInspect on overlay networks only returns containers on the local node. So all nodes picked the same IPs (.253, .252, etc.) causing IP conflicts and context deadline exceeded on ContainerStart.

Evidence

Node heartbeat metricbeat heartbeat IPs
node2 Up 2h Up 2h .253 (static)
node1 Up 51m Up 51m .46 etc (docker-assigned)
node3 (leader) Created (stuck) Created (stuck) empty
node4 Created (stuck) Up 41m empty

@firecow firecow self-assigned this Feb 12, 2026
@firecow firecow force-pushed the fix/skip-static-ip-on-overlay-and-default-bridge branch from dfc897b to 6cc0598 Compare February 12, 2026 09:37
@firecow firecow changed the title Skip static IP on overlay and default bridge networks Fix static IP collisions across swarm nodes Feb 12, 2026
@firecow firecow force-pushed the fix/skip-static-ip-on-overlay-and-default-bridge branch from 6cc0598 to 5e8b3c3 Compare February 12, 2026 09:45
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.
@firecow firecow force-pushed the fix/skip-static-ip-on-overlay-and-default-bridge branch from 5e8b3c3 to 2cdd579 Compare February 12, 2026 11:20
Copy link
Copy Markdown
Contributor

@staal0 staal0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@firecow firecow merged commit f523097 into main Feb 12, 2026
6 checks passed
@firecow firecow deleted the fix/skip-static-ip-on-overlay-and-default-bridge branch February 12, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants