feat: add Smart VXLAN Controller for automated bridge management#426
feat: add Smart VXLAN Controller for automated bridge management#426Sinodaiiii wants to merge 8 commits intok8snetworkplumbingwg:mainfrom
Conversation
Signed-off-by: Sinodaiiii <ds_daisheng@163.com>
Signed-off-by: Sinodaiiii <ds_daisheng@163.com>
Signed-off-by: Sinodaiiii <ds_daisheng@163.com>
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Sinodaiiii The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Sinodaiiii. Thanks for your PR. I'm waiting for a k8snetworkplumbingwg member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary of ChangesHello @Sinodaiiii, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a Smart VXLAN Controller to automate OVS bridge and VXLAN tunnel management. The core logic is sound, but there are a few critical areas for improvement. The controller needs to handle node additions and deletions to maintain correct tunnel state across the cluster. Additionally, there are opportunities to improve performance by using the informer cache instead of making direct API calls, and to make error handling more robust. Overall, this is a great feature that will significantly simplify network management.
Signed-off-by: Sinodaiiii <ds_daisheng@163.com>
Signed-off-by: Sinodaiiii <ds_daisheng@163.com>
Signed-off-by: Sinodaiiii <ds_daisheng@163.com>
…etion Signed-off-by: Sinodaiiii <ds_daisheng@163.com>
This commit transitions the network topology to a Full-Mesh architecture within each bridge: - ovsdb: Disables RSTP/STP on bridges to allow direct connectivity between all nodes. - controller: Implements Split Horizon by setting 'no-flood' on VXLAN ports to prevent broadcast loops. - controller: Adds critical rollback mechanism to delete unsafe ports if flood protection fails. Signed-off-by: Sinodaiiii <ds_daisheng@163.com>
|
Hello @Sinodaiiii, thanks for the very interesting PR. However, I would politely reject it and ask you to implement the controller as a standalone project. I'd be happy to then mention in in the README. We would like to keep this project focused to the core of CNI - to connect workload to the OVS bridge. If I understand your code correctly, it should be possible to implement everything there with separate controllers and CNIs which you would chain before or after the main OVS CNI. Is there anything you think would require tight integration with ovs-cni? Petr |
What this PR does / why we need it:
This PR introduces a "Smart VXLAN Controller" to automate the lifecycle management of OVS bridges and node-to-node connectivity.
The core logic enhancement follows a "Create-on-Demand" and "Connect-Automatically" flow:
Key changes include:
1. On-Demand Bridge Creation (Primary Trigger):
The CNI plugin (
CmdAdd) has been updated to check for the existence of the target OVS bridge. If the bridge does not exist, the plugin now automatically creates it first before attaching the container interface. This removes the prerequisite for manual bridge provisioning on nodes.2. Automated Connectivity (Controller Logic):
A new controller (integrated into the
ovs-cni-markerdaemon) watches Kubernetes Node objects. Once a bridge is successfully created and reported in the node status:3. Intelligent Lifecycle Management (Auto-Delete):
To keep the node clean, the CNI plugin (
CmdDel) now automatically deletes the bridge if it becomes empty (i.e., when the last container port is removed).br-intis explicitly exempted from auto-deletion to preserve default cluster connectivity.4. Underlying Driver Enhancements:
Enhanced
pkg/ovsdbwith necessary primitives for these operations, includingCreateVxlanPort,NewBridgeDriverFromExisting, andIsBridgeEmpty.Why we need it:
Currently, administrators often need to manually provision OVS bridges on every node or use external configuration tools to set up tunnels. This PR makes
ovs-cniself-sufficient in managing the entire datapath lifecycle, significantly reducing operational complexity for dynamic network setups where bridges need to be created and connected on the fly.Special notes for your reviewer:
I have split the changes into 3 atomic commits to facilitate the review process:
feat(ovsdb): Adds underlying driver support for VXLAN operations and bridge management (CreateVxlanPort,NewBridgeDriverFromExisting,IsBridgeEmpty).feat(controller): Implements the main controller logic, updates the CNI plugin to trigger bridge auto-creation/deletion, and updatesvendor/dependencies.feat(marker): Integrates the controller into the main entry point (cmd/marker) to run in the background.Please verify the
vendor/updates in the second commit, as new Kubernetes client dependencies were required for the controller.Release note: