Add peer interface annotation for physical interfaces#191
Add peer interface annotation for physical interfaces#191felix-kaestner wants to merge 1 commit intomainironcore-dev/network-operator:mainfrom
Conversation
328466a to
6f0d313
Compare
| // InterfacePeerAnnotation references the peer Interface resource on the other end of a physical link. | ||
| // The value must be a reference to another Interface resource in the format "namespace/name" | ||
| // or just "name" (for same-namespace references). | ||
| // This annotation is only valid for interfaces of type Physical. | ||
| const InterfacePeerAnnotation = "networking.metal.ironcore.dev/peer-interface" |
There was a problem hiding this comment.
I think aggregated interfaces should be allowed too: "An An LLDP agent can be configured on an IEEE 802.1AX™ Aggregated Port and/or on any number of the physical ports belonging to the Aggregation" [IEEE8021AB-2016]. May be we could leave a note here or extend the commit message if we want to enforce this condition for now.
There was a problem hiding this comment.
I would expect that configuring LLDP on an Aggregate Interface, would lead to configuring it's member Interfaces. As the Aggregate Interface is a logical/virtual construct, for me it's not directly related to the physical cabling, so in this case I would expect that annotation to be on the members instead and not on the aggregate. But I'm happy to discuss.
There was a problem hiding this comment.
Fair point. We also discussed it in our alignment and we won't consider link aggregation. In this context, what do you think about renaming the Annotation to PhysicalInterfaceNeighborAnnotation = "networking.metal.ironcore.dev/interface-neighbor". This would also be more consistent with the LLDP terminology.
There was a problem hiding this comment.
Done. I've also changed this from an annotation to a label (PhysicalInterfaceNeighborLabel) with a same-namespace constraint. This enables filtering via kubectl get interfaces -l networking.metal.ironcore.dev/interface-neighbor=<name> and avoids the / character issue that labels have with the namespace/name format.
| // InterfacePeerAnnotation references the peer Interface resource on the other end of a physical link. | ||
| // The value must be a reference to another Interface resource in the format "namespace/name" | ||
| // or just "name" (for same-namespace references). | ||
| // This annotation is only valid for interfaces of type Physical. | ||
| const InterfacePeerAnnotation = "networking.metal.ironcore.dev/peer-interface" |
There was a problem hiding this comment.
I like using the reference to another resource here. However, I am wondering how we will deal with those interfaces that have peers outside our control and for which we do not have an Interface resource. We won't have a way to verify the cabling.
There was a problem hiding this comment.
We also discussed this and our use case includes also verifying the cabling of interfaces connected to other devices and interfaces that we do not control. Usually the neighbor is a combination of the chassisID or sysName (typically the first since that one is mandatory), and the portId, which is the MAC, the ifAliasor ifName (typically the last one).
So in principle we would like to support both a reference to a physical interface and some sort of string. While this is not immediately pressing, its probably considering this already. What do you think?
There was a problem hiding this comment.
Added PhysicalInterfaceNeighborRawAnnotation for this use case. The format is chassisID::portID (e.g., spine-switch-01::Ethernet48 or 00:1a:2b:3c:4d:5e::Ethernet1/1). This remains an annotation since the value can exceed the 63-character label limit with long chassis/port identifiers.
The label and raw annotation are mutually exclusive - the webhook rejects interfaces that have both set.
|
do we want to use an annotation in this case ? this makes it harder for cli tools to display / filter for it correctly I think |
6f0d313 to
f9dff4d
Compare
@SchwarzM Changed to a label with a same-namespace constraint - the value is now just the interface name (no namespace prefix). This enables filtering while keeping the value label-compatible. |
This patch introduces the `PhysicalInterfaceNeighborLabel` label which references the peer Interface resource on the other end of a physical link. The label can be used by users to declare expected cabling, or by controllers to reflect actual cabling discovered via neighbor discovery protocols (e.g., LLDP). The label value must be the name of another Interface resource in the same namespace. It is only valid for interfaces of type Physical. Additionally, a `PhysicalInterfaceNeighborRawAnnotation` annotation is introduced for interfaces connected to unmanaged devices (devices without an Interface resource). The annotation value format is "chassisID::portID" where chassisID is the LLDP chassis identifier and portID is the LLDP port identifier. Both the label and annotation are mutually exclusive - an interface cannot have both set at the same time.
f9dff4d to
69e45b9
Compare
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
nikatza
left a comment
There was a problem hiding this comment.
Nice, thanks for the update!
This patch introduces the
PhysicalInterfaceNeighborLabellabel whichreferences the peer Interface resource on the other end of a physical
link. The label can be used by users to declare expected cabling, or
by controllers to reflect actual cabling discovered via neighbor
discovery protocols (e.g., LLDP).
The label value must be the name of another Interface resource in the
same namespace. It is only valid for interfaces of type Physical.
Additionally, a
PhysicalInterfaceNeighborRawAnnotationannotation isintroduced for interfaces connected to unmanaged devices (devices
without an Interface resource). The annotation value format is
"chassisID::portID" where chassisID is the LLDP chassis identifier
and portID is the LLDP port identifier.
Both the label and annotation are mutually exclusive - an interface
cannot have both set at the same time.