containernetworking / plugins

Some reference and example networking plugins, maintained by the CNI team.
Apache License 2.0
2.14k stars 775 forks source link

ptp: Enabling L2 mode #987

Open Tjaarda1 opened 8 months ago

Tjaarda1 commented 8 months ago

Current Situation:

When utilizing the PTP plugin to establish a connection between two containers, the current workflow necessitates the use of IP Address Management (IPAM) to assign IP addresses to the connected veth pair.

Enhancement Proposal:

It would greatly enhance the usability of the PTP plugin if there were an option to create the veth pair without explicitly specifying IP addresses. This would parallel the simplicity offered by bridge configurations, making the PTP plugin more versatile. In certain scenarios, the use of PTP proves to be a superior alternative to bridge configurations, and eliminating the mandatory requirement for IP addresses would streamline the setup process.

Expected Behavior:

mccv1r0 commented 8 months ago

Can't you just leave IPAM plugin out?

Tjaarda1 commented 8 months ago

Can't you just leave IPAM plugin out?

No, the documentation specifies it is a required field. Leaving it as an empty dictionary will result in an unexpected behavior, with the message "no plugin name provided". (While if you fill the IPAM fields, it will work as expected). This behavior has been tested both in a microk8s cluster and a kubeadm one.

Edit: I've checked the code and in the bridge plugin this option is contemplated by checking the value of the IPAM field, while in ptp, it's not the case.