Repository navigation
net: reconcile SiteNodeSlices per Site - #915
Patrick W. Healy (phealy) wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Event targeting can miss affected Sites, leaving stale Node membership or missing connectivity slices.
3 open findings
What changed in this PR
Reduces controller API load by reconciling SiteNodeSlices only for affected Sites.
Changes:
- Adds per-Site dirty tracking and cache-based no-op checks.
- Moves orphan repair to a separate periodic loop.
- Adds reconciliation tests and design documentation.
| File | Description |
|---|---|
| internal/net/controller/site_controller.go | Targets reconciliation and defers orphan repair. |
| internal/net/controller/site_controller_helpers_test.go | Tests targeted work, no-op reads, and malformed-slice repair. |
| designs/site-node-slices.md | Documents reconciliation scope and live-state safeguards. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bfe4d9c to
7bfcdac
Compare
|
Fixed the operator migration-window e2e expectation in 6d86219. With user approval, the test now restarts the real controller with the orphan already present and verifies the production startup repair deletes it while preserving current and legacy Site slices. The real kind-based focused e2e passed locally using the Podman provider; test compilation and scoped formatting/lint also pass. |
6d86219 to
2f4d572
Compare
2f4d572 to
c7236c5
Compare
c7236c5 to
8602e7f
Compare
Auto-merge was disabled for another pull request in the stack
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
SiteNodeSlice membership is derived from internal IPs, so Node updates and deletions dirty both the labeled and IP-matched Sites. Slice updates dirty both the old and new siteName so the original Site can repair a slice that the new Site deletes as extra. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Restart the real controller with the orphan already present and retain checks for current and legacy Site slices. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
8602e7f to
6d2009d
Compare

Summary
Reconcile SiteNodeSlices one Site at a time instead of reconsidering every Site on any change.
designs/site-node-slices.mddocuments the approach.Testing
Unit tests cover:
Stack
This is one of five stacked PRs that reduce API server load from unbounded-net-controller and unbounded-net-node. Kubernetes remains the source of truth. Review them bottom to top:
Motivation. A large cluster running v0.8.0 had the controller continuously writing objects that hadn't changed. Every node agent also watched the whole cluster's gateway topology. On a canary cluster, the full stack cut controller API calls by 54.4% and node agent API calls by 73.8%.