feat: Hub-and-Spoke (partial mesh) topology with spoke-to-spoke routing - #433
Open
Shreesha001 wants to merge 28 commits into
Open
feat: Hub-and-Spoke (partial mesh) topology with spoke-to-spoke routing#433Shreesha001 wants to merge 28 commits into
Shreesha001 wants to merge 28 commits into
Conversation
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
… in tests Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
- pin Hubs to MaxItems=1 (schema now matches the single-hub webhook rule) - order the single-hub check before the duplicate check; mark both as defense-in-depth behind the schema limit - comment the unreachable spokes==0 guard - clarify the sample is API/validation-only (topology not yet consumed) - add trailing newline to sample; regen CRD with controller-gen v0.19.0 Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
…gy test cases Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
…dition Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
…e#304) Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
…logy changes Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
… error Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
…mber cluster CR is missing Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
…ch to connection-state changes; keep NONET test mocks consistent Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
test(): correct mock client type and remove deprecated ClusterName field in tests
…y-crd feat(): add hub-and-spoke topology fields to SliceConfig CRD
…mputation Feature/302 edge computation
…aggregation feat(): aggregate gateway health into SliceConfig TopologyConverged status (kubeslice#303)
# Conflicts: # apis/worker/v1alpha1/workerslicegateway_types.go # config/crd/bases/worker.kubeslice.io_workerslicegateways.yaml
… (now that gateway + status code is present) Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
…sitive false failures Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
feat(): route entire slice subnet via hub for spoke-to-spoke (kubeslice#304)
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Copilot reviewed 25 out of 28 changed files in this pull request and generated 4 comments.
Files not reviewed (3)
- apis/controller/v1alpha1/zz_generated.deepcopy.go: Generated file
- apis/worker/v1alpha1/zz_generated.deepcopy.go: Generated file
- service/mocks/IWorkerSliceGatewayService.go: Generated file
Comment on lines
+6
to
+10
| # Note: this sample exercises the API and validation only. As of this | ||
| # release the controller does not yet consume spec.topology to change | ||
| # gateway/peer link creation (that is follow-up implementation work); | ||
| # the intended result once it does is hub<->spoke links only | ||
| # (worker-1<->worker-2, worker-1<->worker-3) and no spoke<->spoke link. |
Comment on lines
+2
to
+14
| * Copyright (c) 2026 Avesha, Inc. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. |
| run(t, "", "kubectl", "--context", kubeContext, "patch", "sliceconfig", sliceName, | ||
| "-n", projectNS, "--type=merge", | ||
| "-p", `{"spec":{"topology":{"mode":"HubAndSpoke","hubs":["worker-2"]}}}`) | ||
| time.Sleep(6 * time.Second) |
Comment on lines
+15
to
+22
| The feature spans three repositories: | ||
|
|
||
| | Repo | Role | | ||
| |---|---| | ||
| | `kubeslice-controller` | Topology API + webhook validation, edge computation, marks each spoke's gateway with `RouteEntireSliceSubnet`, and aggregates gateway health into the SliceConfig `TopologyConverged` status | | ||
| | `worker-operator` | Programs the entire-slice route on **both** the spoke gateway pod and the slice router, and reports each gateway's tunnel connectivity back to the hub | | ||
| | `gateway-sidecar` | Installs the tunnel route as two more-specific halves so NSM cannot overwrite it | | ||
| | `apis` | Shared CRD types — the topology fields and the gateway connection-status fields | |
…sleep with a settle gate in e2e Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
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.
Description
Merges the completed Hub-and-Spoke partial-mesh work from
hub-spoke-integration-branch. A slice can now run inHubAndSpokemode: the controller builds only hub↔spoke gateways (no spoke↔spoke links), marks each spoke's gateway withRouteEntireSliceSubnetso the spoke routes the whole slice to the hub, and the hub relays traffic between spokes. It also aggregates every gateway's tunnel health into a singleTopologyConvergedcondition on the SliceConfig, so the slice reports whether the mesh is fully connected. Omittingtopology(ormode: FullMesh) keeps today's full-mesh behaviour unchanged.The feature spans four repos. This PR is the
kubeslice-controllerside (topology API and webhook validation, edge computation, theRouteEntireSliceSubnetmarking, and theTopologyConvergedstatus aggregation). The matchingworker-operator,gateway-sidecar, andapischanges are their own PRs.All 5 PRs behind this are already merged into
hub-spoke-integration-branch(#404, #408, #410, #422, #424). Nothing new is added here.Fixes #300, #301, #302, #303, #304
How Has This Been Tested?
go test ./service/... ./controllers/...clean, including the envtest reconciler specs insliceconfig_hubandspoke_test.go(base partial-mesh, hub-change round-trip, partial-pair self-heal, and no-network rejection). The automated control-plane e2e suite (make test-e2e-hns) passes on a disposable Kind cluster, covering partial-mesh creation, full-mesh backward compatibility, topology-change flag reconciliation, and webhook rejection of every malformed topology.The dataplane was verified end-to-end on real cross-cloud clusters: a 3-cluster hub-and-spoke across Oracle OKE and two Linode LKE clusters, where two spokes with no direct link reached each other through the hub at 0% packet loss (~54 ms across two clouds), throughput held over
iperf, and live add/remove-spoke and topology-change edits reconverged on their own. Full commands and observed results are indocs/hub-and-spoke-testing.md.Checklist
docs/hub-and-spoke-testing.md).Does this PR introduce a breaking change for other components like worker-operator?
No. A slice with no
topology(ormode: FullMesh) keeps the existing full-mesh behaviour, and the new topology and status fields are all optional.