feat: add Multus secondary CNI support - #2496
Draft
fanyang89 wants to merge 6 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Multus secondary CNI support by introducing a new easytier-cni delegate plugin that provisions a per-Pod EasyTier instance via a root-only Unix-socket RPC portal, along with netns plumbing and integration test scripts/manifests to validate Kubernetes/Kind operation.
Changes:
- Add Unix-socket RPC portal support to
easytier-coreand expose anetnsfield in the management API config. - Introduce the
easytier-cnibinary implementing delegated IPv4 IPAM + ADD/DEL/CHECK lifecycle behavior. - Add deployment manifests, documentation, CI packaging tweaks, and netns/Kind integration test scripts.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| easytier/src/rpc_service/api.rs | Adds ApiRpcServer::new_unix to serve RPC over Unix domain sockets. |
| easytier/src/proto/api_manage.proto | Extends NetworkConfig with an optional netns field for namespace targeting. |
| easytier/src/launcher.rs | Switches into configured netns before starting the instance runtime; adjusts runtime mode selection. |
| easytier/src/core.rs | Chooses between TCP vs Unix RPC servers based on --rpc-portal scheme prefix. |
| easytier/src/common/netns.rs | Adds netns path resolution (supporting absolute /proc/.../ns/net) and fallible NetNSGuard::try_new. |
| easytier-contrib/easytier-cni/src/main.rs | Implements the new CNI plugin: delegated IPAM, instance lifecycle via RPC, and interface verification. |
| easytier-contrib/easytier-cni/Cargo.toml | Adds a new workspace member crate for the CNI plugin and its dependencies. |
| easytier-contrib/easytier-cni/README.md | Documents installation, configuration, and lifecycle semantics for the CNI plugin. |
| easytier-contrib/easytier-cni/deploy/daemonset.yaml | Provides a privileged DaemonSet that installs the CNI binary and runs the Unix-socket daemon. |
| easytier-contrib/easytier-cni/deploy/network-attachment-definition.yaml | Adds a sample NAD for Multus with delegated Whereabouts IPAM. |
| easytier-contrib/easytier-cni/test-netns.sh | Adds a root netns-based integration test for ADD/CHECK/DEL behavior. |
| easytier-contrib/easytier-cni/test-kind.sh | Adds a reproducible Kind+Multus+Whereabouts multi-node integration test script. |
| Cargo.toml | Adds easytier-contrib/easytier-cni to the workspace members list. |
| Cargo.lock | Records dependency resolution for the new easytier-cni crate. |
| .github/workflows/core.yml | Updates CI path filters and packaging to include building/compressing easytier-cni for musl targets. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
# Conflicts: # .github/workflows/core.yml # Cargo.lock # easytier/src/launcher.rs # easytier/src/rpc_service/api.rs
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.
Summary
0600Unix socket after persisted instances are restoredScope
Validation
cargo clippy --all-targets --features full --all -- -D warningscargo test --package easytier-cnicargo test --package easytier --lib runtime_unix_rpccargo test --package easytier-core config::api --libcargo check --package easytier --bin easytier-coreshellcheck easytier-contrib/easytier-cni/test-netns.sh easytier-contrib/easytier-cni/test-kind.shactionlint -shellcheck= .github/workflows/core.yml .github/workflows/test.ymlFinal Kind result:
10.200.0.11 -> 10.200.0.10, 5/5 ping replies, 0% packet loss.