Skip to content

feat: Hub-and-Spoke (partial mesh) topology with spoke-to-spoke routing - #433

Open
Shreesha001 wants to merge 28 commits into
kubeslice:masterfrom
Shreesha001:hub-spoke-integration-branch
Open

feat: Hub-and-Spoke (partial mesh) topology with spoke-to-spoke routing#433
Shreesha001 wants to merge 28 commits into
kubeslice:masterfrom
Shreesha001:hub-spoke-integration-branch

Conversation

@Shreesha001

Copy link
Copy Markdown

Description

Merges the completed Hub-and-Spoke partial-mesh work from hub-spoke-integration-branch. A slice can now run in HubAndSpoke mode: the controller builds only hub↔spoke gateways (no spoke↔spoke links), marks each spoke's gateway with RouteEntireSliceSubnet so 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 single TopologyConverged condition on the SliceConfig, so the slice reports whether the mesh is fully connected. Omitting topology (or mode: FullMesh) keeps today's full-mesh behaviour unchanged.

The feature spans four repos. This PR is the kubeslice-controller side (topology API and webhook validation, edge computation, the RouteEntireSliceSubnet marking, and the TopologyConverged status aggregation). The matching worker-operator, gateway-sidecar, and apis changes 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 in sliceconfig_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 in docs/hub-and-spoke-testing.md.


Checklist

  • The title of the PR states what changed and the related issue numbers (used for the release note).
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added all the required unit test cases.
  • I've updated documentation as required by this PR (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 (or mode: FullMesh) keeps the existing full-mesh behaviour, and the new topology and status fields are all optional.

Shreesha001 and others added 27 commits July 5, 2026 12:36
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
…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)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Comment thread test/e2e/scenarios_test.go Outdated
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 thread docs/hub-and-spoke-testing.md Outdated
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design/ADR: Partial Mesh MVP = Hub-and-Spoke topology

3 participants