feat(): route entire slice subnet via hub for spoke gateways - #496
Draft
Shreesha001 wants to merge 4 commits into
Draft
feat(): route entire slice subnet via hub for spoke gateways#496Shreesha001 wants to merge 4 commits into
Shreesha001 wants to merge 4 commits into
Conversation
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
…outer Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
…-subnet case Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
Shreesha001
requested review from
Rahul-D78,
bharath-avesha,
gourishkb and
richiesebastian
as code owners
August 3, 2026 13:30
Shreesha001
marked this pull request as draft
August 3, 2026 13:30
pnavali
requested review from
rajendra-avesha
and
a lite review from Copilot
and removed request for
richiesebastian
August 19, 2026 12:31
There was a problem hiding this comment.
Pull request overview
Adds Hub-and-Spoke “route entire slice subnet via hub” behavior for spoke gateways by propagating a new routeEntireSliceSubnet flag and using it to choose the remote NSM subnet programmed into both the gateway pod and the slice router.
Changes:
- Propagates
RouteEntireSliceSubnetfrom hubWorkerSliceGatewayinto worker-clusterSliceGatewaystatus config. - Introduces a shared route-decision helper (
remoteNsmSubnetForRoute) plus unit tests, and updates gateway-pod + slice-router connection-context programming to use it (with requeue when slice subnet isn’t available yet). - Vendors an
apisfork (viago.mod replace) to pick up the new API field and accompanying generated code updates.
Reviewed changes
Copilot reviewed 7 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vendor/modules.txt | Updates vendored module metadata to reflect the apis fork replacement. |
| vendor/github.com/kubeslice/apis/pkg/worker/v1alpha1/zz_generated.deepcopy.go | Updates autogenerated deepcopy logic for WorkerSliceGateway status. |
| vendor/github.com/kubeslice/apis/pkg/worker/v1alpha1/workerslicegateway_types.go | Adds RouteEntireSliceSubnet to WorkerSliceGatewaySpec and expands gateway status fields/constants. |
| vendor/github.com/kubeslice/apis/pkg/controller/v1alpha1/zz_generated.deepcopy.go | Updates autogenerated deepcopy logic for new controller-side types. |
| vendor/github.com/kubeslice/apis/pkg/controller/v1alpha1/cluster_types.go | Adds StorageCapabilities types/fields to ClusterStatus (vendored). |
| pkg/hub/controllers/slicegateway_controller.go | Propagates RouteEntireSliceSubnet into worker-cluster SliceGateway status config updates. |
| go.sum | Adds checksums for the apis fork and removes the original module checksums. |
| go.mod | Adds a replace to an apis fork to access the new field pre-merge. |
| controllers/slicegateway/slicegateway.go | Adds remoteSubnetForGateway and uses it when sending connection context to gateway pods and slice router (with requeue). |
| controllers/slicegateway/slicegateway_route.go | Adds the shared helper to decide remote subnet for routing. |
| controllers/slicegateway/slicegateway_route_test.go | Adds unit tests for the route-decision helper. |
| config/crd/bases/networking.kubeslice.io_slicegateways.yaml | Extends the CRD schema to include routeEntireSliceSubnet under status.config. |
| api/v1beta1/slicegateway_types.go | Adds RouteEntireSliceSubnet to the SliceGatewayConfig model. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+951
to
+954
| // The returned subnet is programmed both into the local slice router (so pods | ||
| // reach the gateway) and into the gateway pod itself (so it forwards the traffic | ||
| // over the tunnel); both must agree, otherwise packets loop at the gateway. | ||
| // |
Comment on lines
+105
to
+106
|
|
||
| replace github.com/kubeslice/apis => github.com/Shreesha001/apis v0.0.0-20260716162233-4dfda414c6d2 |
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
Worker side of spoke-to-spoke communication for Hub-and-Spoke slices.
Two spokes have no direct tunnel, so their traffic has to go through the hub.
When a spoke's gateway to the hub has
routeEntireSliceSubnetset (the controller sets this), the worker programs the entire slice subnet—not just the hub's subnet—into both the slice router and the gateway pod.That makes the spoke send all slice traffic (including traffic for other spokes) to the hub, which relays it to the destination spoke.
A shared helper (
remoteNsmSubnetForRoute) keeps the slice-router and gateway-pod paths in sync, and requeues if the slice subnet isn't known yet.How Has This Been Tested?
On a 4-cluster kind setup (1 hub + 3 workers), Hub-and-Spoke slice:
slicegateway_route_test.go).Checklist
go fmt.Does this PR introduce a breaking change?