-
Notifications
You must be signed in to change notification settings - Fork 24
feat: Replicate host routing rules and tables in pod #280
feat: Replicate host routing rules and tables in pod #280
Conversation
|
only skimmed during 1 minute but this looks pretty neat |
There was a problem hiding this 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
RuleConfigtype 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.
414ae56 to
4312637
Compare
gauravkghildiyal
left a comment
There was a problem hiding this 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!
7db1af4 to
b14154e
Compare
|
Overall lgtm! |
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.
b14154e to
6c00b61
Compare
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: