Skip to content

Fix overlay network IP assignment#55

Merged
firecow merged 3 commits intomainfrom
fix/skip-static-ip-on-overlay
Feb 12, 2026
Merged

Fix overlay network IP assignment#55
firecow merged 3 commits intomainfrom
fix/skip-static-ip-on-overlay

Conversation

@firecow
Copy link
Copy Markdown
Member

@firecow firecow commented Feb 12, 2026

  • Start container on bridge first, then connect networks after start
  • On a running container, overlay NetworkConnect performs the full VXLAN handshake immediately, making IP conflicts detectable and retryable
  • Derive per-node IP offset from swarm node ID to avoid cross-node contention
  • Retry from high IP downward, up to 100 attempts per network
  • Skip static IP on default bridge and docker_gwbridge

@firecow firecow self-assigned this Feb 12, 2026
Replace the pre-computed containerIndex approach with connect-then-retry:
try the highest free IP, if it conflicts (used on another node invisible
to local NetworkInspect), try the next one down, up to 100 attempts.

Also skip static IP assignment on docker_gwbridge.
@firecow firecow force-pushed the fix/skip-static-ip-on-overlay branch from 0fc82a8 to 9ffdcdf Compare February 12, 2026 12:00
@firecow firecow changed the title Fix overlay network IP collisions breaking monitoring containers Fix static IP collisions across swarm nodes Feb 12, 2026
staal0
staal0 previously approved these changes Feb 12, 2026
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

When connecting overlay networks to a non-running container, NetworkConnect
succeeds locally but the actual VXLAN handshake is deferred to ContainerStart,
where cross-node IP conflicts cause an unrecoverable timeout. By starting the
container first (on bridge) and then connecting overlay networks one at a time,
the handshake happens immediately during NetworkConnect, making IP conflicts
detectable and retryable.
@firecow firecow changed the title Fix static IP collisions across swarm nodes Fix overlay network IP assignment by connecting after start Feb 12, 2026
Derive a deterministic IP offset from the swarm node ID so each node
starts at a different position in the high IP range, avoiding cross-node
retry timeouts. Remove splitNetworksByScope and inline attachNetwork.
@firecow firecow changed the title Fix overlay network IP assignment by connecting after start Fix overlay network IP assignment Feb 12, 2026
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 3688107 into main Feb 12, 2026
6 checks passed
@firecow firecow deleted the fix/skip-static-ip-on-overlay branch February 12, 2026 16:47
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