Skip to content

Commit c664aa5

Browse files
committed
feat: Network Virtualization Endpoints (NVEs)
* Adds support for NVEs. The core type `NVE` requires at least two loopback interfaces on the same device, and an optional field for Multicastgroup. * Includes a Cisco NXOS specfic settings in `cisco.nx.v1alpha1.NVEConfig` * The `NVEConfig` also modifies system and fabric forwarding settings.
1 parent 4c4a814 commit c664aa5

46 files changed

Lines changed: 3544 additions & 149 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎PROJECT‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,27 @@ resources:
206206
kind: RoutingPolicy
207207
path: github.com/ironcore-dev/network-operator/api/core/v1alpha1
208208
version: v1alpha1
209+
- api:
210+
crdVersion: v1
211+
namespaced: true
212+
controller: true
213+
domain: networking.metal.ironcore.dev
214+
kind: NVE
215+
path: github.com/ironcore-dev/network-operator/api/core/v1alpha1
216+
version: v1alpha1
217+
webhooks:
218+
validation: true
219+
webhookVersion: v1
220+
- api:
221+
crdVersion: v1
222+
namespaced: true
223+
domain: cisco.networking.metal.ironcore.dev
224+
group: nx
225+
kind: NVEConfig
226+
controller: false
227+
path: github.com/ironcore-dev/network-operator/api/cisco/nx/v1alpha1
228+
version: v1alpha1
229+
webhooks:
230+
validation: true
231+
webhookVersion: v1
209232
version: "3"

‎Tiltfile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ k8s_resource(new_name='ccloud-prefixset', objects=['ccloud-prefixset:prefixset']
111111
k8s_yaml('./config/samples/v1alpha1_routingpolicy.yaml')
112112
k8s_resource(new_name='bgp-import-policy', objects=['bgp-import-policy:routingpolicy', 'internal-networks:prefixset', 'partner-networks:prefixset', 'blocked-networks:prefixset'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
113113

114+
k8s_yaml('./config/samples/v1alpha1_nve.yaml')
115+
k8s_yaml('./config/samples/cisco/nx/v1alpha1_nveconfig.yaml')
116+
k8s_resource(new_name='nve1', objects=['nve1:nve'], trigger_mode=TRIGGER_MODE_MANUAL, resource_deps=['lo0', 'lo1'], auto_init=False)
117+
k8s_resource(new_name='nve1-cfg', objects=['nve1-cfg:nveconfig'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
118+
114119
print('🚀 network-operator development environment')
115120
print('👉 Edit the code inside the api/, cmd/, or internal/ directories')
116121
print('👉 Tilt will automatically rebuild and redeploy when changes are detected')

‎api/cisco/nx/v1alpha1/groupversion_info.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ var (
2222
// AddToScheme adds the types in this group-version to the given scheme.
2323
AddToScheme = SchemeBuilder.AddToScheme
2424
)
25+
26+
// Reasons that are specific to [NVEConfig] objects.
27+
const (
28+
NVEConfigAlreadyExistsReason = "NVEConfigAlreadyExists"
29+
)
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and IronCore contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package v1alpha1
5+
6+
import (
7+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8+
9+
v1alpha1 "github.com/ironcore-dev/network-operator/api/core/v1alpha1"
10+
)
11+
12+
// +kubebuilder:rbac:groups=nx.cisco.networking.metal.ironcore.dev,resources=nveconfigs,verbs=get;list;watch
13+
14+
// NVEConfig defines the Cisco-specific configuration of a Network Virtualization Object
15+
type NVEConfigSpec struct {
16+
// AdvertiseVirtualMAC controls if the NVE should advertise a virtual MAC address
17+
// +optional
18+
// +kubebuilder:default=false
19+
AdvertiseVirtualMAC bool `json:"advertiseVirtualMAC,omitempty"`
20+
21+
// HoldDownTime defines the duration for which the switch suppresses the advertisement of the NVE loopback address.
22+
// +optional
23+
// +kubebuilder:validation:Minimum=1
24+
// +kubebuilder:validation:Maximum=1500
25+
// +kubebuilder:default=180
26+
HoldDownTime uint16 `json:"holdDownTime,omitempty"`
27+
28+
// InfraVLANs specifies VLANs used by all SVI interfaces for uplink and vPC peer-links in VXLAN as infra-VLANs.
29+
// The total number of VLANs configured must not exceed 512.
30+
// Elements in the list must not overlap with each other.
31+
// +optional
32+
// +kubebuilder:validation:MaxItems=10
33+
InfraVLANs []VLANListItem `json:"infraVLANs,omitempty"`
34+
}
35+
36+
// VLANListItem represents a single VLAN ID or a range start-end. If ID is set, rangeMin and rangeMax must be absent. If ID is absent, both rangeMin
37+
// and rangeMax must be set.
38+
// +kubebuilder:validation:XValidation:rule="!has(self.rangeMax) || self.rangeMax > self.rangeMin",message="rangeMax must be greater than rangeMin"
39+
// +kubebuilder:validation:XValidation:rule="has(self.id) || (has(self.rangeMin) && has(self.rangeMax))",message="either ID or both rangeMin and rangeMax must be set"
40+
// +kubebuilder:validation:XValidation:rule="!has(self.id) || (!has(self.rangeMin) && !has(self.rangeMax))",message="rangeMin and rangeMax must be omitted when ID is set"
41+
type VLANListItem struct {
42+
// +optional
43+
// +kubebuilder:validation:Minimum=1
44+
// +kubebuilder:validation:Maximum=3967
45+
ID uint16 `json:"id,omitempty"`
46+
// +optional
47+
// +kubebuilder:validation:Minimum=1
48+
// +kubebuilder:validation:Maximum=3967
49+
RangeMin uint16 `json:"rangeMin,omitempty"`
50+
// +optional
51+
// +kubebuilder:validation:Minimum=1
52+
// +kubebuilder:validation:Maximum=3967
53+
RangeMax uint16 `json:"rangeMax,omitempty"`
54+
}
55+
56+
// +kubebuilder:object:root=true
57+
// +kubebuilder:resource:path=nveconfigs
58+
// +kubebuilder:resource:singular=nveconfig
59+
60+
// NVEConfig is the Schema for the NVE API
61+
type NVEConfig struct {
62+
metav1.TypeMeta `json:",inline"`
63+
metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`
64+
65+
// spec defines the desired state of NVE
66+
// +required
67+
Spec NVEConfigSpec `json:"spec"`
68+
}
69+
70+
// +kubebuilder:object:root=true
71+
72+
// NVEList contains a list of NVE
73+
type NVEConfigList struct {
74+
metav1.TypeMeta `json:",inline"`
75+
metav1.ListMeta `json:"metadata,omitempty"`
76+
Items []NVEConfig `json:"items"`
77+
}
78+
79+
// init registers the NVEConfig type with the core v1alpha1 scheme and sets
80+
// itself as a dependency for the NVE core type.
81+
func init() {
82+
v1alpha1.RegisterNVEDependency(GroupVersion.WithKind("NVEConfig"))
83+
SchemeBuilder.Register(&NVEConfig{}, &NVEConfigList{})
84+
}

‎api/cisco/nx/v1alpha1/zz_generated.deepcopy.go‎

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/core/v1alpha1/groupversion_info.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ const (
109109

110110
// WaitingForDependenciesReason indicates that the resource is waiting for its dependencies to be ready.
111111
WaitingForDependenciesReason = "WaitingForDependencies"
112+
113+
// IncompatibleProviderConfigRef indicates that the referenced provider configuration is not compatible with the target platform.
114+
IncompatibleProviderConfigRef = "IncompatibleProviderConfigRef"
112115
)
113116

114117
// Reasons that are specific to [Interface] objects.

0 commit comments

Comments
 (0)