antrea
antrea copied to clipboard
Support secondarynetwork update
This PR introduces support for adding or deleting secondary network configurations for Pods by dynamically reconciling the k8s.v1.cni.cncf.io/networks annotation. Users can now add new secondary network configurations or remove existing ones during a Pod's lifecycle, and the changes will be applied without requiring Pod recreation.
Key Changes:
- Annotation lifecycle support:
- Adding the
k8s.v1.cni.cncf.io/networksannotation to a Pod triggers creation of all specified secondary network interfaces - Deleting the annotation triggers removal of all associated secondary network interfaces
- Adding the
- Unsupported operations:
- ❌ Modifying existing network entries in the annotation (e.g., adding/removing individual interfaces from the array)
- ❌ Changing interface parameters for existing network definitions
Implementation Details:
- Controller Logic: Extended the existing network controller to handle annotation updates and invoke CNI plugins for interface lifecycle operations.
- Cleanup Mechanism: Remove orphaned interfaces when annotations are deleted.
TestDone:
- Added unit and e2e tests covering:
- Full
k8s.v1.cni.cncf.io/networksannotation addition → interface creation - Full
k8s.v1.cni.cncf.io/networksannotation deletion → interface removal
- Full
Notes:
- Pods must be in a running state for annotation changes to take effect
- Interface deletions may cause brief connectivity interruptions
- Interface-level modifications are not supported - only complete annotation addition/deletion
Resolves https://github.com/antrea-io/antrea/issues/7065
Depends on #7116
/test-sriov-secondary-network-e2e
Can one of the admins verify this patch?
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
@wenqiq please update the description about what's kind of update events have been handled in this PR.
@wenqiq please re-base to the latest codes in https://github.com/antrea-io/antrea/pull/7116
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
/test-sriov-secondary-network-e2e
@tnqn @luolanzone @antoninbas @jianjuns Addressed comments . Could you help take another look at this PR?
@wenqiq please resolve code conflicts.
/test-sriov-secondary-network-e2e
@wenqiq please update the title to ensure it's precise.
Probably "Support k8s.v1.cni.cncf.io/networks annotation removal or reset to blank to clean up Pod's secondary interfaces"
/test-sriov-secondary-network-e2e
/test-all
@luolanzone @wenqiq : next time please trim the commit description to be <= 72 chars, and also update the commit message before merging.
The commit was merged with the following commit message:
- Support secondarynetwork update
It does not match the change.
@luolanzone @wenqiq : next time please trim the commit description to be <= 72 chars, and also update the commit message before merging.
Got it. Will pay attention to editing each commit message before pushing.