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

Allow multi NAD in attractor #421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Allow multi NAD in attractor #421

wants to merge 1 commit into from

Conversation

LionelJouin
Copy link
Member

@LionelJouin LionelJouin commented May 26, 2023

Description

Multi NAD allows multiple network interfaces to be added to the attractor pods. The feature is already developed, only some conditions prevented its usage.
The interface name that will be injected in the frontend via the environment variable will be the one specified in the attractor specs

Example with multiple NADs: https://gist.github.com/LionelJouin/3cf494db1db592fb01b16ff16b6493c8

Issue link

/

Checklist

  • Purpose
    • Bug fix
    • New functionality
    • Documentation
    • Refactoring
    • CI
  • Test
    • Unit test
    • E2E Test
    • Tested manually
  • Introduce a breaking change
    • Yes (description required)
    • No

Multi NAD allows multiple network interfaces to be added to the attractor pods.
The feature is already developed, only some conditions prevented its
usage.
The interface name that will be injected in the frontend via the
environment variable will be the one specified in the attractor specs
"NFE_TRENCH_NAME": l.trench.ObjectMeta.Name,
"NFE_ATTRACTOR_NAME": l.attractor.ObjectMeta.Name,
"NFE_NAMESPACE": l.attractor.ObjectMeta.Namespace,
"NFE_EXTERNAL_INTERFACE": l.attractor.Spec.Interface.Name,
Copy link
Collaborator

@zolug zolug Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember right, when the code appends the annotations, the interface name to be used in the POD is decided based on NAD config in the Attractor. Meaning, if there's no interface name in the NAD, the code will derive the name from the Specs.Interface.Name.
So, based on this change, the "primary" Attractor NAD supplying the external interface must not have an Interface Name set.
Also, in case multiple NADs are set, but none of them have an interface name specified, the code would try to re-use the same Specs.Interface.Name as POD interface names when appending the NADs to the resource template, wouldn't it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the user should give a specific interface name in the non-primary network-attachments in the attractor spec. The primary one should not have any name (or it should match with the .Specs.Interface.Name).

There is an example here: https://gist.github.com/LionelJouin/3cf494db1db592fb01b16ff16b6493c8
The attractor has 2 NADs, and the macvlan is a secondary one, the primary one is the vlan-100 that will get the ext-vlan0 name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants