Repository navigation
net: adopt and acknowledge node assignments in the agent - #917
Draft
Patrick W. Healy (phealy) wants to merge 3 commits into
Draft
Patrick W. Healy (phealy) wants to merge 3 commits into
Patrick W. Healy (phealy) wants to merge 3 commits into
Conversation
Pin Site and GatewayPool membership for the agent lifetime, acknowledge the effective values, and fence managed CNI bootstrap to the adopted Node assignment while retaining Site-driven gateway CNI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Monitor only the own Node from adoption through bootstrap and initial reconciliation, cancel startup on assignment or identity changes independently of dataplane success, and stop the watch after effective acknowledgment is persisted. Revalidate after disconnects and preserve mismatch causes without allowing stale acknowledgments. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Retry only patch races (conflicts and failed JSON patch tests) with capped exponential backoff, and return admission denials immediately instead of spinning until the cleanup context expires. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Patrick W. Healy (phealy)
added this pull request to stack #919
October 14, 2026 23:10
This was referenced Oct 14, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Transition cleanup has unresolved concurrency and recovery issues that can leave stale networking configuration, advertisements, or taints.
4 open findings
What changed in this PR
Pins each node agent’s assignment for its process lifetime and acknowledges it for controller-driven replacement, supporting the API-load reduction stack.
Changes:
- Adopt assignments and monitor changes until acknowledgment succeeds.
- Tie CNI setup and transition cleanup to the adopted assignment.
- Add bounded taint-removal retries and lifecycle tests.
| File | Description |
|---|---|
cmd/unbounded-net-node/startup_assignment_watch_test.go |
Tests watch cancellation and revalidation. |
cmd/unbounded-net-node/site_watch_reconcile.go |
Integrates acknowledgment and transition cleanup. |
cmd/unbounded-net-node/node_types.go |
Tracks adopted assignment and taint state. |
cmd/unbounded-net-node/main.go |
Wires adoption into startup. |
cmd/unbounded-net-node/gateway_taint_test.go |
Tests retry classification and limits. |
cmd/unbounded-net-node/gateway_pool_peering_protocol_test.go |
Tests gateway readiness requirements. |
cmd/unbounded-net-node/bootstrap_helpers.go |
Validates bootstrap assignments and removes taints. |
cmd/unbounded-net-node/bootstrap_helpers_test.go |
Checks taint removal. |
cmd/unbounded-net-node/bootstrap_assignment_test.go |
Tests assignment-aware CNI bootstrap. |
cmd/unbounded-net-node/assignment.go |
Implements adoption, monitoring, and acknowledgment. |
cmd/unbounded-net-node/assignment_test.go |
Tests assignment lifecycle helpers. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
|
|
||
| defer cleanupNodeNetworkingOnShutdown(cfg, state) | ||
| defer cleanupForAssignmentTransition(cfg, state, dynamicClient, gatewayNodeInformer) |
Comment on lines
+533
to
+534
| if adopted.gatewayPool != "" { | ||
| if err := syncGatewayNodeRoutesStatus(cleanupCtx, dynamicClient, gatewayNodeInformer, state.nodeName, nil); err != nil { |
Comment on lines
+539
to
+541
| if adopted.gatewayPool != "" && current.gatewayPool == "" { | ||
| if err := removeGatewayNodeTaint(cleanupCtx, state.clientset, state.nodeName); err != nil { | ||
| klog.Errorf("Failed to remove gateway taint during role demotion: %v", err) |
| } | ||
| } | ||
|
|
||
| cleanupNodeNetworkingOnShutdown(cfg, state, transition) |
This branch has not been deployed
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
Have the node agent adopt its Site and GatewayPool assignment once per process and acknowledge it.
Testing
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%.