-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] make VLAN IPs unique across controller pod restarts #544
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #544 +/- ##
==========================================
- Coverage 64.82% 63.63% -1.20%
==========================================
Files 79 79
Lines 4299 5486 +1187
==========================================
+ Hits 2787 3491 +704
- Misses 1242 1719 +477
- Partials 270 276 +6 ☔ View full report in Codecov by Sentry. |
util/vlanips.go
Outdated
if addr.Type == clusterv1.MachineInternalIP { | ||
if ipnet.Contains(net.ParseIP(addr.Address)) { | ||
existingIPs = append(existingIPs, addr.Address) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
if addr.Type == clusterv1.MachineInternalIP { | |
if ipnet.Contains(net.ParseIP(addr.Address)) { | |
existingIPs = append(existingIPs, addr.Address) | |
} | |
} | |
if addr.Type == clusterv1.MachineInternalIP && ipnet.Contains(net.ParseIP(addr.Address)) { | |
existingIPs = append(existingIPs, addr.Address) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit, otherwise LGTM
What this PR does / why we need it:
With the VLAN clusters, a in-memory map was maintained for each cluster's IPs. When the controller pod restarts, that IP map is lost, and any further cluster scaling activities cause the nodes to get overlapping IPs.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Testing steps
make local-deploy
off mainrke2-vlan
flavormd
. describe thelinodemachines
and see that more than one linode has the same vlanIPmake local-deploy
off this branchlinodemachines
TODOs: