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
14 changes: 14 additions & 0 deletions api/core/v1alpha1/evpninstance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
// [RFC 8365]: https://datatracker.ietf.org/doc/html/rfc8365
//
// +kubebuilder:validation:XValidation:rule="self.type != 'Bridged' || has(self.vlanRef)",message="VLANRef must be specified when Type is Bridged"
// +kubebuilder:validation:XValidation:rule="self.type != 'Routed' || has(self.vrfRef)",message="VRFRef must be specified when Type is Routed"
// +kubebuilder:validation:XValidation:rule="self.type != 'Routed' || !has(self.routeDistinguisher)",message="RouteDistinguisher must not be set when Type is Routed"
type EVPNInstanceSpec 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 @@ -50,7 +52,11 @@ type EVPNInstanceSpec struct {
MulticastGroupAddress string `json:"multicastGroupAddress,omitempty"`

// RouteDistinguisher is the route distinguisher for the EVI.
// This field is only applicable when Type is Bridged (MAC-VRF).
// For Routed type, the route distinguisher is configured on the referenced VRF instead.
// Set to "Auto" for automatic derivation (equivalent to "rd auto").
// Formats supported:
// - "Auto" (automatic derivation)
// - Type 0: ASN(0-65535):Number(0-4294967295)
// - Type 1: IPv4:Number(0-65535)
// - Type 2: ASN(65536-4294967295):Number(0-65535)
Expand All @@ -71,6 +77,14 @@ type EVPNInstanceSpec struct {
// +optional
// +kubebuilder:validation:XValidation:rule="self.name == oldSelf.name",message="VLANRef is immutable"
VLANRef *LocalObjectReference `json:"vlanRef,omitempty"`

// VRFRef is a reference to a VRF resource for which this EVPNInstance provides the L3VNI.
// This field is only applicable when Type is Routed (L3VNI).
// The VRF resource must exist in the same namespace.
// Immutable.
// +optional
// +kubebuilder:validation:XValidation:rule="self.name == oldSelf.name",message="VRFRef is immutable"
VRFRef *LocalObjectReference `json:"vrfRef,omitempty"`
}

// EVPNInstanceType defines the type of EVPN instance.
Expand Down
7 changes: 7 additions & 0 deletions api/core/v1alpha1/vrf_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
)

// RouteDistinguisherAuto is the special value for automatic RD derivation (equivalent to "rd auto").
const RouteDistinguisherAuto = "Auto"

// VRFSpec defines the desired state of VRF
type VRFSpec struct {
// DeviceName is the name of the Device this object belongs to. The Device object must exist in the same namespace.
Expand Down Expand Up @@ -39,13 +42,17 @@ type VRFSpec struct {
Description string `json:"description,omitempty"`

// VNI is the VXLAN Network Identifier for the VRF (always an L3).
//
// Deprecated: Use the VNI field on the EVPNInstance resource instead. This field will be removed in a future release.
// +optional
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=16777215
VNI uint32 `json:"vni,omitempty"`

// RouteDistinguisher is the route distinguisher for the VRF.
// Set to "Auto" for automatic derivation (equivalent to "rd auto").
// Formats supported:
// - "Auto" (automatic derivation)
// - Type 0: ASN(0-65535):Number(0-4294967295)
// - Type 1: IPv4:Number(0-65535)
// - Type 2: ASN(65536-4294967295):Number(0-65535)
Expand Down
5 changes: 5 additions & 0 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.

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

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

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

8 changes: 6 additions & 2 deletions config/crd/bases/networking.metal.ironcore.dev_vrfs.yaml

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

7 changes: 4 additions & 3 deletions docs/api-reference/index.md

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

Loading
Loading