Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions api/core/v1alpha1/interface_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
// +kubebuilder:validation:XValidation:rule="self.type == 'RoutedVLAN' || !has(self.ipv4) || !self.ipv4.anycastGateway", message="anycastGateway can only be enabled for interfaces of type RoutedVLAN"
// +kubebuilder:validation:XValidation:rule="self.type != 'Aggregate' || !has(self.vrfRef)", message="vrfRef must not be specified for interfaces of type Aggregate"
// +kubebuilder:validation:XValidation:rule="self.type != 'Physical' || !has(self.switchport) || !has(self.vrfRef)", message="vrfRef must not be specified for Physical interfaces with switchport configuration"
// +kubebuilder:validation:XValidation:rule="self.type != 'Aggregate' || !has(self.bfd)", message="bfd must not be specified for interfaces of type Aggregate"
// +kubebuilder:validation:XValidation:rule="!has(self.bfd) || !has(self.switchport)", message="bfd must not be specified for interfaces with switchport configuration"
type InterfaceSpec struct {
// DeviceName is the name of the Device this object belongs to. The Device object must exist in the same namespace.
// Immutable.
Expand Down Expand Up @@ -86,6 +88,11 @@ type InterfaceSpec struct {
// The referenced VRF must exist in the same namespace.
// +optional
VrfRef *LocalObjectReference `json:"vrfRef,omitempty"`

// BFD defines the Bidirectional Forwarding Detection configuration for the interface.
// BFD is only applicable for Layer 3 interfaces (Physical, Loopback, RoutedVLAN).
// +optional
BFD *BFD `json:"bfd,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I was checkingOpenConfig's and they do it differently. We could follow their approach, which would have the advantage of reducing the number of gNMI calls (on cisco nxos, as far as we know). However, this definition here seems more natural to me. Do you have any idea why they decided that structure instead? (just curious)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually though that it's quite similar to the openconfig-bfd model, as they also model these properties on a per interface level. Only that they separated it under a different module and tree. However, as I've spoken with @swagner-de we agreed that it would make more sense to keep it on the Interface resource rather than creating a new custom resource for these properties.

}

// AdminState represents the administrative state of the interface.
Expand Down Expand Up @@ -193,6 +200,39 @@ type InterfaceIPv4Unnumbered struct {
InterfaceRef LocalObjectReference `json:"interfaceRef"`
}

// BFD defines the Bidirectional Forwarding Detection configuration for an interface.
type BFD struct {
// Enabled indicates whether BFD is enabled on the interface.
// +required
Enabled bool `json:"enabled"`

// DesiredMinimumTxInterval is the minimum interval between transmission of BFD control
// packets that the operator desires. This value is advertised to the peer.
// The actual interval used is the maximum of this value and the remote
// required-minimum-receive interval value.
// +optional
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
DesiredMinimumTxInterval *metav1.Duration `json:"desiredMinimumTxInterval,omitempty"`

// RequiredMinimumReceive is the minimum interval between received BFD control packets
// that this system should support. This value is advertised to the remote peer to
// indicate the maximum frequency between BFD control packets that is acceptable
// to the local system.
// +optional
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
RequiredMinimumReceive *metav1.Duration `json:"requiredMinimumReceive,omitempty"`

// DetectionMultiplier is the number of packets that must be missed to declare
// this session as down. The detection interval for the BFD session is calculated
// by multiplying the value of the negotiated transmission interval by this value.
// +optional
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=255
DetectionMultiplier *int32 `json:"detectionMultiplier,omitempty"`
}

type Aggregation struct {
// MemberInterfaceRefs is a list of interface references that are part of the aggregate interface.
// +required
Expand Down
23 changes: 2 additions & 21 deletions api/core/v1alpha1/isis_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ type ISISSpec struct {
// +kubebuilder:validation:MaxItems=2
AddressFamilies []AddressFamily `json:"addressFamilies"`

// Interfaces is a list of interfaces that are part of the ISIS instance.
// InterfaceRefs is a list of interfaces that are part of the ISIS instance.
// +optional
// +listType=atomic
Interfaces []ISISInterface `json:"interfaces,omitempty"`
InterfaceRefs []LocalObjectReference `json:"interfaceRefs,omitempty"`
}

// ISISLevel represents the level of an ISIS instance.
Expand Down Expand Up @@ -83,25 +83,6 @@ const (
AddressFamilyIPv6Unicast AddressFamily = "IPv6Unicast"
)

type ISISInterface struct {
// Ref is a reference to the interface object.
// The interface object must exist in the same namespace.
// +required
Ref LocalObjectReference `json:"ref"`

// BFD contains BFD configuration for the interface.
// +optional
// +kubebuilder:default={}
BFD ISISBFD `json:"bfd,omitzero"`
}

type ISISBFD struct {
// Enabled indicates whether BFD is enabled on the interface.
// +optional
// +kubebuilder:default=false
Enabled bool `json:"enabled"`
}

// ISISStatus defines the observed state of ISIS.
type ISISStatus struct {
// The conditions are a list of status objects that describe the state of the ISIS.
Expand Down
73 changes: 38 additions & 35 deletions api/core/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,42 @@ spec:
required:
- memberInterfaceRefs
type: object
bfd:
description: |-
BFD defines the Bidirectional Forwarding Detection configuration for the interface.
BFD is only applicable for Layer 3 interfaces (Physical, Loopback, RoutedVLAN).
properties:
desiredMinimumTxInterval:
description: |-
DesiredMinimumTxInterval is the minimum interval between transmission of BFD control
packets that the operator desires. This value is advertised to the peer.
The actual interval used is the maximum of this value and the remote
required-minimum-receive interval value.
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
detectionMultiplier:
description: |-
DetectionMultiplier is the number of packets that must be missed to declare
this session as down. The detection interval for the BFD session is calculated
by multiplying the value of the negotiated transmission interval by this value.
format: int32
maximum: 255
minimum: 1
type: integer
enabled:
description: Enabled indicates whether BFD is enabled on the interface.
type: boolean
requiredMinimumReceive:
description: |-
RequiredMinimumReceive is the minimum interval between received BFD control packets
that this system should support. This value is advertised to the remote peer to
indicate the maximum frequency between BFD control packets that is acceptable
to the local system.
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
required:
- enabled
type: object
description:
description: Description provides a human-readable description of
the interface.
Expand Down Expand Up @@ -407,6 +443,10 @@ spec:
- message: vrfRef must not be specified for Physical interfaces with switchport
configuration
rule: self.type != 'Physical' || !has(self.switchport) || !has(self.vrfRef)
- message: bfd must not be specified for interfaces of type Aggregate
rule: self.type != 'Aggregate' || !has(self.bfd)
- message: bfd must not be specified for interfaces with switchport configuration
rule: '!has(self.bfd) || !has(self.switchport)'
status:
description: |-
Status of the resource. This is set and updated automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,40 +98,25 @@ spec:
x-kubernetes-validations:
- message: Instance is immutable
rule: self == oldSelf
interfaces:
description: Interfaces is a list of interfaces that are part of the
ISIS instance.
interfaceRefs:
description: InterfaceRefs is a list of interfaces that are part of
the ISIS instance.
items:
description: |-
LocalObjectReference contains enough information to locate a
referenced object inside the same namespace.
properties:
bfd:
default: {}
description: BFD contains BFD configuration for the interface.
properties:
enabled:
default: false
description: Enabled indicates whether BFD is enabled on
the interface.
type: boolean
type: object
ref:
name:
description: |-
Ref is a reference to the interface object.
The interface object must exist in the same namespace.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
maxLength: 63
minLength: 1
type: string
required:
- name
type: object
x-kubernetes-map-type: atomic
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
maxLength: 63
minLength: 1
type: string
required:
- ref
- name
type: object
x-kubernetes-map-type: atomic
type: array
x-kubernetes-list-type: atomic
networkEntityTitle:
Expand Down
40 changes: 40 additions & 0 deletions config/crd/bases/networking.metal.ironcore.dev_interfaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,42 @@ spec:
required:
- memberInterfaceRefs
type: object
bfd:
description: |-
BFD defines the Bidirectional Forwarding Detection configuration for the interface.
BFD is only applicable for Layer 3 interfaces (Physical, Loopback, RoutedVLAN).
properties:
desiredMinimumTxInterval:
description: |-
DesiredMinimumTxInterval is the minimum interval between transmission of BFD control
packets that the operator desires. This value is advertised to the peer.
The actual interval used is the maximum of this value and the remote
required-minimum-receive interval value.
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
detectionMultiplier:
description: |-
DetectionMultiplier is the number of packets that must be missed to declare
this session as down. The detection interval for the BFD session is calculated
by multiplying the value of the negotiated transmission interval by this value.
format: int32
maximum: 255
minimum: 1
type: integer
enabled:
description: Enabled indicates whether BFD is enabled on the interface.
type: boolean
requiredMinimumReceive:
description: |-
RequiredMinimumReceive is the minimum interval between received BFD control packets
that this system should support. This value is advertised to the remote peer to
indicate the maximum frequency between BFD control packets that is acceptable
to the local system.
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
required:
- enabled
type: object
description:
description: Description provides a human-readable description of
the interface.
Expand Down Expand Up @@ -401,6 +437,10 @@ spec:
- message: vrfRef must not be specified for Physical interfaces with switchport
configuration
rule: self.type != 'Physical' || !has(self.switchport) || !has(self.vrfRef)
- message: bfd must not be specified for interfaces of type Aggregate
rule: self.type != 'Aggregate' || !has(self.bfd)
- message: bfd must not be specified for interfaces with switchport configuration
rule: '!has(self.bfd) || !has(self.switchport)'
status:
description: |-
Status of the resource. This is set and updated automatically.
Expand Down
Loading