Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Conversation

@gauravkghildiyal
Copy link
Member

This change enables DRANET to discover and replicate host routing rules and routes from non-default tables into the pod's network namespace.

Previously, only routes from the main table were copied. This was insufficient for advanced networking configurations that rely on policy-based routing (ip rule) and multiple routing tables (like source based routing)

This commit introduces the following changes:

  • The driver now inspects the host for ip rule entries associated with a network interface.
  • It also inspects for ip route entries in non-default tables.
  • These rules and routes are then replicated within the pod's network namespace when it's created.
  • An end-to-end test has been added to validate this functionality.

@aojea
Copy link
Collaborator

aojea commented Nov 12, 2025

only skimmed during 1 minute but this looks pretty neat

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for replicating host routing rules and routes from non-default routing tables into pod network namespaces, enabling advanced networking configurations like policy-based routing and source-based routing in DRANET.

  • Introduces a new RuleConfig type to represent routing rules with priority, source/destination CIDRs, and routing table ID
  • Extends route discovery to include routes from all tables (not just main), and adds rule discovery with interface association logic
  • Adds validation, documentation, and end-to-end testing for the new functionality

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/apis/types.go Adds RuleConfig type and Table field to RouteConfig
pkg/apis/validation.go Adds validation logic for rules and route table fields
pkg/apis/validation_test.go Adds comprehensive test coverage for rule and route table validation
pkg/driver/dra_hooks.go Implements route discovery from all tables and rule discovery with interface association
pkg/driver/netnamespace.go Implements rule application in pod network namespace
pkg/driver/nri_hooks.go Integrates rule configuration into pod sandbox creation
tests/e2e.bats Adds end-to-end test for rule and route replication
site/content/docs/user/interface-configuration.md Documents the new RuleConfig structure and Table field

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member Author

@gauravkghildiyal gauravkghildiyal left a comment

Choose a reason for hiding this comment

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

Thanks for the reviews!

@gauravkghildiyal gauravkghildiyal force-pushed the copy-route-rules branch 2 times, most recently from 7db1af4 to b14154e Compare November 26, 2025 02:44
@michaelasp
Copy link
Collaborator

Overall lgtm!

michaelasp
michaelasp previously approved these changes Nov 26, 2025
This change enables DRANET to discover and replicate host routing rules and
routes from non-default tables into the pod's network namespace.

Previously, only routes from the main table were copied. This was insufficient
for advanced networking configurations that rely on policy-based routing (ip
rule) and multiple routing tables (like source based routing)

This commit introduces the following changes:
- The driver now inspects the host for ip rule entries associated with a network
  interface.
- It also inspects for ip route entries in non-default tables.
- These rules and routes are then replicated within the pod's network namespace
  when it's created.
- An end-to-end test has been added to validate this functionality.
@gauravkghildiyal gauravkghildiyal merged commit bb7e8b7 into google:main Nov 26, 2025
7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants