Skip to content

Implement EVPN Fabric loopback reconciliation#353

Open
felix-kaestner wants to merge 10 commits into
fabric-crdfrom
fabric-loopbacks
Open

Implement EVPN Fabric loopback reconciliation#353
felix-kaestner wants to merge 10 commits into
fabric-crdfrom
fabric-loopbacks

Conversation

@felix-kaestner

Copy link
Copy Markdown
Contributor

Reconcile lo0 (Router-ID), lo1/lo2 (VTEP), and lo100 (anycast RP) loopback Claims and Interfaces for all fabric devices. The Fabric becomes the controller owner of each Claim so the Owns() watch re-enqueues correctly. Interfaces are only created once the Claim is allocated; a guard at the top of Reconcile short-circuits when the provider does not implement InterfaceProvider.

Extend provider interface with LoopbackInterfaceName so each driver can return a vendor-specific handle for a given loopback index.

Add envtest suite covering Claims, Interfaces, ownership, and the Ready condition.

@felix-kaestner
felix-kaestner requested a review from a team May 12, 2026 16:54
@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label May 13, 2026
@hardikdr hardikdr added this to Roadmap May 13, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 45 days with no activity.

The previously used logo had a low resolution and didn't work well in
dark mode and the navigation header. With this change we are replacing
it with the standard IronCore logo which is also inline with other
projects such as the metal-operator.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
SVGs are resolution-independent, render natively in browsers,
and avoid Git LFS complications for the docs build.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Introduces three pool types (IndexPool, IPAddressPool, IPPrefixPool) and
a Claim type that references a pool via spec.poolRef. The claim
controller allocates the lowest available resource from the referenced
pool and writes it back to both the pool status and the claim status.
Pools track allocations with ClaimRef+ClaimUID for idempotency, and
support Recycle/Retain reclaim policies on claim deletion. All pool
types expose an Available condition (HasCapacity/Exhausted).

A preferred value can be requested by setting the annotation
pool.networking.metal.ironcore.dev/preferred-value on a Claim. The
controller will attempt to allocate that exact value; if it is outside
the pool's configured ranges or already taken, the claim enters a
terminal error state with reason PreferredValueUnavailable. Removing
the annotation re-triggers reconciliation and falls back to normal
allocation.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Documents the pool-based allocation system introduced alongside the
IndexPool, IPAddressPool, IPPrefixPool, and Claim types. Covers pool
and claim concepts, reclaim policies, the preferred-value annotation,
and allocation result fields. Includes light/dark theme diagram images
and links to sample manifests in the repository.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Replace the embedded Status.Allocations lists on pool types with
dedicated Kubernetes objects (Index, IPAddress, IPPrefix) that model
allocations as first-class resources following the PV/PVC pattern.

Previously, the claim controller reserved values by appending entries
to a pool's status and used optimistic locking on the pool status
update to prevent races. This coupled allocation state tightly to the
pool object and made it impossible to pre-provision or inspect
individual allocations.

The new design introduces three allocation types — Index, IPAddress,
and IPPrefix — each with a spec containing the reserved value, a
poolRef back to the owning pool, and an optional claimRef binding it
to a Claim. The claim controller now creates allocation objects with
deterministic names derived from the pool name and value (e.g.
my-pool-64512), using the API server's name-uniqueness guarantee as
the concurrency guard: two controllers racing for the same value
both attempt Create, exactly one succeeds, the other retries via
retry.OnError with a fresh list of used values.

Pool types implement a Pool interface with Allocate and
ListAllocations methods. Allocate receives the existing allocation
objects, builds a used-value set, finds the first free slot, and
returns a ready-to-create allocation object. ListAllocations
encapsulates the typed List call and returns []Allocation, an
interface providing GetClaimRef, SetClaimRef, and GetValue so the
claim controller operates generically without type switches.

Pool controllers count allocations by listing objects via a shared
poolRef field index rather than reading Status.Allocations. The
allocation type controllers (Index, IPAddress, IPPrefix) validate
each object's value against its pool's ranges/prefixes and set a
Valid condition. The claim controller's finalize path applies the
pool's reclaim policy: Recycle deletes the allocation object,
Retain clears its claimRef so the value persists as reserved but
unbound.

The AllowBindingAnnotation enables rebinding of allocation objects
whose claimRef name matches a Claim but whose UID is stale, such
as after a Claim is deleted and recreated with the same name.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Reflect the migration from embedded pool status allocations to
dedicated allocation objects. Document the new allocation types
(Index, IPAddress, IPPrefix), deterministic naming, pre-provisioning
with the allow-binding annotation, and the updated claim status
fields (status.value, status.allocationRef). Update the flow
diagram to match the simplified allocation and reclaim logic.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Remove the per-entry IPPrefixPoolPrefix struct and promote
prefixLength to IPPrefixPoolSpec. This simplifies the API and
eliminates ambiguity when multiple base prefixes are defined.

The prefixes list is now []IPPrefix with +listType=set, preventing
duplicate entries at admission time.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
This high-level CRD will take care of creating and managing all
low-level resources that are required to build a EVPN VXLAN resource.

Its controller implementation is intentionally left empty to a large
extend to be extended by future changes. The setup constructs a list of
sub-reconciler functions that are called in sequence to build up the
full lifecycle of the `Fabric`.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Reconcile lo0 (Router-ID), lo1/lo2 (VTEP), and lo100 (anycast RP)
loopback Claims and Interfaces for all fabric devices. The Fabric
becomes the controller owner of each Claim so the Owns() watch
re-enqueues correctly. Interfaces are only created once the Claim
is allocated; a guard at the top of Reconcile short-circuits when
the provider does not implement InterfaceProvider.

Extend provider interface with LoopbackInterfaceName so each driver
can return a vendor-specific handle for a given loopback index.

Add envtest suite covering Claims, Interfaces, ownership, and the
Ready condition.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations. size/XL

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants