Skip to content

Commit 43677af

Browse files
committed
implement routingdomain reconciliation
RoutingDomain controller reconciles IP-VRF & L3EVI NetworkAttachment controller configures anycast GW Re-use VNI RT calculation & fabric identification for devices
1 parent ed6bc60 commit 43677af

21 files changed

Lines changed: 1564 additions & 225 deletions

‎api/evpn/v1alpha1/groupversion_info.go‎

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

3737
// NetworkAttachmentLabel identifies the NetworkAttachment that realizes an EVPN resource.
3838
NetworkAttachmentLabel = "evpn.networking.metal.ironcore.dev/network-attachment"
39+
40+
// RoutingDomainLabel identifies the RoutingDomain associated with an EVPN resource.
41+
RoutingDomainLabel = "evpn.networking.metal.ironcore.dev/routing-domain"
3942
)
4043

4144
// Fabric condition types.
@@ -76,6 +79,9 @@ const (
7679
// NetworkNotFoundReason indicates that the referenced Network does not exist.
7780
NetworkNotFoundReason = "NetworkNotFound"
7881

82+
// RoutingDomainNotFoundReason indicates that the referenced RoutingDomain does not exist.
83+
RoutingDomainNotFoundReason = "RoutingDomainNotFound"
84+
7985
// InvalidVNIReason indicates that an allocated VNI is invalid.
8086
InvalidVNIReason = "InvalidVNI"
8187

‎api/overlay/v1alpha1/network_types.go‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ import (
1212

1313
// NetworkSpec defines the desired state of Network
1414
type NetworkSpec struct {
15-
RoutingDomainRef v1alpha1.LocalObjectReference `json:"routingDomainRef,omitempty"`
16-
IPv4 *IPv4 `json:"ipv4,omitempty"`
15+
// +optional
16+
RoutingDomainRef *v1alpha1.LocalObjectReference `json:"routingDomainRef,omitempty"`
17+
// +optional
18+
IPv4 *IPv4 `json:"ipv4,omitempty"`
1719
}
1820

1921
type IPv4 struct {
2022
// Address is the IP prefix for the SVI's Anycast Gateway
21-
Address string `json:"cidr,omitempty"`
23+
Address v1alpha1.IPPrefix `json:"address,omitempty"`
2224
}
2325

2426
// NetworkStatus defines the observed state of Network.

‎api/overlay/v1alpha1/routingdomain_types.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ import (
1212
type RoutingDomainSpec struct {
1313
// +required
1414
// +kubebuilder:validation:MinLength=1
15-
// +kubebuilder:validation:MaxLength=63
15+
// +kubebuilder:validation:MaxLength=32
1616
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Name is immutable"
1717
Name string `json:"name"`
1818
}
1919

2020
// RoutingDomainStatus defines the observed state of RoutingDomain.
2121
type RoutingDomainStatus struct {
22-
2322
// The conditions are a list of status objects that describe the state of the RoutingDomain.
2423
// +listType=map
2524
// +listMapKey=type

‎api/overlay/v1alpha1/zz_generated.deepcopy.go‎

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

‎charts/network-operator/templates/crd/networks.overlay.networking.metal.ironcore.dev.yaml‎

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎charts/network-operator/templates/crd/routingdomains.overlay.networking.metal.ironcore.dev.yaml‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/main.go‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,15 @@ func main() { //nolint:gocyclo
867867
os.Exit(1)
868868
}
869869

870+
if err := (&evpncontroller.RoutingDomainReconciler{
871+
Client: mgr.GetClient(),
872+
Scheme: mgr.GetScheme(),
873+
Recorder: mgr.GetEventRecorder("routingdomain-controller"),
874+
}).SetupWithManager(ctx, mgr); err != nil {
875+
setupLog.Error(err, "Failed to create controller", "controller", "evpn-routingdomain")
876+
os.Exit(1)
877+
}
878+
870879
if err := (&corecontroller.ProbeReconciler{
871880
Client: mgr.GetClient(),
872881
Scheme: mgr.GetScheme(),
@@ -907,13 +916,7 @@ func main() { //nolint:gocyclo
907916
setupLog.Error(err, "Failed to create controller", "controller", "NetworkAttachment")
908917
os.Exit(1)
909918
}
910-
if err := (&overlaycontroller.RoutingDomainReconciler{
911-
Client: mgr.GetClient(),
912-
Scheme: mgr.GetScheme(),
913-
}).SetupWithManager(mgr); err != nil {
914-
setupLog.Error(err, "Failed to create controller", "controller", "overlay-routingdomain")
915-
os.Exit(1)
916-
}
919+
917920
// +kubebuilder:scaffold:builder
918921

919922
if metricsCertWatcher != nil {

‎config/crd/bases/overlay.networking.metal.ironcore.dev_networks.yaml‎

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎config/crd/bases/overlay.networking.metal.ironcore.dev_routingdomains.yaml‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/api-reference/index.md‎

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

0 commit comments

Comments
 (0)