Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface name is now mandatory for dynamic networks attachements #63

Open
kmabda opened this issue Nov 1, 2022 · 3 comments
Open

interface name is now mandatory for dynamic networks attachements #63

kmabda opened this issue Nov 1, 2022 · 3 comments

Comments

@kmabda
Copy link
Collaborator

kmabda commented Nov 1, 2022

In multus a network interface name in a pod is optional, if the user didn't provide an interface name in the pod's network annotation the latter will be given a net1, net2, etc. as interface name.

To be able to hot-plug/unplug an network interface in a running pod the user must provide an interface name (as it should be) for the network-selection-elements

If a pod get configured with a multus network annotation without providing an interface name, it's not possible to unplug an interface from a running pod unless one add an interface name to the desired network-selection-elements (which would fails since the interface is already plugged) than unplug it (not a good user experience)

see also #48

To Reproduce
Steps to reproduce the behavior:

  1. use the example in the README.md https://github.com/maiqueb/multus-dynamic-networks-controller#adding--removing-network-interfaces
  2. remove the only network annotation element present
  3. the request would be rejected since the selected network element don't have an interface name.

Environment:

  • multus-dynamic-networks-controller version: N/A
  • Kubernetes version (use kubectl version): N/A
  • Network-attachment-definition: N/A
  • OS (e.g. from /etc/os-release): N/A
  • Controller configuration (criSocketPath / multusSocketPath): N/A
  • Kernel (e.g. uname -a): N/A
  • Others: N/A

Additional info / context
Not sure how this should be resolved since we can't change current multus behaviour regarding having an interface name optional, but though this should be tracked some how!

@maiqueb
Copy link
Collaborator

maiqueb commented Nov 2, 2022

How about we adapt the code to reject handling the update of an existing attachment ? I.e. allow the user to patch the existing annotation's on a pod adding the interface name to the network selection elements, without triggering add / remove of the interface ?

This was my original intention, and honestly, I thought the current code would do that.

... I just checked and can confirm it doesn't.
@kmabda

@kmabda
Copy link
Collaborator Author

kmabda commented Nov 2, 2022

@maiqueb yeah I think that's would be one approach of handling it right now with the current deficient edge level triggered updates strategy.

This would apply I assume as well to other NetworkSelectionElement elements which are not relevant to hot-plug/unplug an interface into a running pod e.g. IPRequest, MacRequest etc.

Ideally would be nice to give feedback why things didn't works as expected when someone let say hot-plug/hot-unplug a network selection element without providing an interface name when doing kubectl describe pod in the events log or when modifying attributes not relevant to the add/del operation (didn't check if this is already the case or not though)

@maiqueb
Copy link
Collaborator

maiqueb commented Nov 2, 2022

Yeah - my intention is to prevent the update of any existing attachment. That would be outside the scope of this project.

Hmm, we could throw an event / log.

Opened #66 to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants