Refactor interface references to use structured format

Refactored all interface references in IPAM configuration to use the
structured format with kind and data fields instead of simple lists.
This improves consistency and makes the configuration more maintainable.
This commit is contained in:
Damien
2026-02-21 17:41:11 +01:00
parent 807f3ce8a1
commit 4aecc544da
2 changed files with 360 additions and 72 deletions

View File

@@ -11,171 +11,371 @@ spec:
# ============================================================ # ============================================================
- address: "10.0.250.1/32" - address: "10.0.250.1/32"
description: spine1 Router-ID description: spine1 Router-ID
interface: ["spine1", "Loopback0"] interface:
kind: InfraInterfaceLoopback
data:
device: ["spine1"]
name: Loopback0
- address: "10.0.250.2/32" - address: "10.0.250.2/32"
description: spine2 Router-ID description: spine2 Router-ID
interface: ["spine2", "Loopback0"] interface:
kind: InfraInterfaceLoopback
data:
device: ["spine2"]
name: Loopback0
- address: "10.0.250.11/32" - address: "10.0.250.11/32"
description: leaf1 Router-ID description: leaf1 Router-ID
interface: ["leaf1", "Loopback0"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf1"]
name: Loopback0
- address: "10.0.250.12/32" - address: "10.0.250.12/32"
description: leaf2 Router-ID description: leaf2 Router-ID
interface: ["leaf2", "Loopback0"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf2"]
name: Loopback0
- address: "10.0.250.13/32" - address: "10.0.250.13/32"
description: leaf3 Router-ID description: leaf3 Router-ID
interface: ["leaf3", "Loopback0"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf3"]
name: Loopback0
- address: "10.0.250.14/32" - address: "10.0.250.14/32"
description: leaf4 Router-ID description: leaf4 Router-ID
interface: ["leaf4", "Loopback0"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf4"]
name: Loopback0
- address: "10.0.250.15/32" - address: "10.0.250.15/32"
description: leaf5 Router-ID description: leaf5 Router-ID
interface: ["leaf5", "Loopback0"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf5"]
name: Loopback0
- address: "10.0.250.16/32" - address: "10.0.250.16/32"
description: leaf6 Router-ID description: leaf6 Router-ID
interface: ["leaf6", "Loopback0"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf6"]
name: Loopback0
- address: "10.0.250.17/32" - address: "10.0.250.17/32"
description: leaf7 Router-ID description: leaf7 Router-ID
interface: ["leaf7", "Loopback0"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf7"]
name: Loopback0
- address: "10.0.250.18/32" - address: "10.0.250.18/32"
description: leaf8 Router-ID description: leaf8 Router-ID
interface: ["leaf8", "Loopback0"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf8"]
name: Loopback0
# ============================================================ # ============================================================
# Loopback1 addresses (VTEP) — /32 # Loopback1 addresses (VTEP) — /32
# ============================================================ # ============================================================
- address: "10.0.255.11/32" - address: "10.0.255.11/32"
description: leaf1 VTEP (shared VTEP1) description: leaf1 VTEP (shared VTEP1)
interface: ["leaf1", "Loopback1"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf1"]
name: Loopback1
- address: "10.0.255.11/32" - address: "10.0.255.11/32"
description: leaf2 VTEP (shared VTEP1) description: leaf2 VTEP (shared VTEP1)
interface: ["leaf2", "Loopback1"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf2"]
name: Loopback1
- address: "10.0.255.12/32" - address: "10.0.255.12/32"
description: leaf3 VTEP (shared VTEP2) description: leaf3 VTEP (shared VTEP2)
interface: ["leaf3", "Loopback1"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf3"]
name: Loopback1
- address: "10.0.255.12/32" - address: "10.0.255.12/32"
description: leaf4 VTEP (shared VTEP2) description: leaf4 VTEP (shared VTEP2)
interface: ["leaf4", "Loopback1"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf4"]
name: Loopback1
- address: "10.0.255.13/32" - address: "10.0.255.13/32"
description: leaf5 VTEP (shared VTEP3) description: leaf5 VTEP (shared VTEP3)
interface: ["leaf5", "Loopback1"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf5"]
name: Loopback1
- address: "10.0.255.13/32" - address: "10.0.255.13/32"
description: leaf6 VTEP (shared VTEP3) description: leaf6 VTEP (shared VTEP3)
interface: ["leaf6", "Loopback1"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf6"]
name: Loopback1
- address: "10.0.255.14/32" - address: "10.0.255.14/32"
description: leaf7 VTEP (shared VTEP4) description: leaf7 VTEP (shared VTEP4)
interface: ["leaf7", "Loopback1"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf7"]
name: Loopback1
- address: "10.0.255.14/32" - address: "10.0.255.14/32"
description: leaf8 VTEP (shared VTEP4) description: leaf8 VTEP (shared VTEP4)
interface: ["leaf8", "Loopback1"] interface:
kind: InfraInterfaceLoopback
data:
device: ["leaf8"]
name: Loopback1
# ============================================================ # ============================================================
# Spine1 P2P underlay — /31 # Spine1 P2P underlay — /31
# ============================================================ # ============================================================
- address: "10.0.1.0/31" - address: "10.0.1.0/31"
description: spine1 Ethernet1 to leaf1 description: spine1 Ethernet1 to leaf1
interface: ["spine1", "Ethernet1"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine1"]
name: Ethernet1
- address: "10.0.1.2/31" - address: "10.0.1.2/31"
description: spine1 Ethernet2 to leaf2 description: spine1 Ethernet2 to leaf2
interface: ["spine1", "Ethernet2"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine1"]
name: Ethernet2
- address: "10.0.1.4/31" - address: "10.0.1.4/31"
description: spine1 Ethernet3 to leaf3 description: spine1 Ethernet3 to leaf3
interface: ["spine1", "Ethernet3"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine1"]
name: Ethernet3
- address: "10.0.1.6/31" - address: "10.0.1.6/31"
description: spine1 Ethernet4 to leaf4 description: spine1 Ethernet4 to leaf4
interface: ["spine1", "Ethernet4"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine1"]
name: Ethernet4
- address: "10.0.1.8/31" - address: "10.0.1.8/31"
description: spine1 Ethernet5 to leaf5 description: spine1 Ethernet5 to leaf5
interface: ["spine1", "Ethernet5"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine1"]
name: Ethernet5
- address: "10.0.1.10/31" - address: "10.0.1.10/31"
description: spine1 Ethernet6 to leaf6 description: spine1 Ethernet6 to leaf6
interface: ["spine1", "Ethernet6"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine1"]
name: Ethernet6
- address: "10.0.1.12/31" - address: "10.0.1.12/31"
description: spine1 Ethernet7 to leaf7 description: spine1 Ethernet7 to leaf7
interface: ["spine1", "Ethernet7"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine1"]
name: Ethernet7
- address: "10.0.1.14/31" - address: "10.0.1.14/31"
description: spine1 Ethernet8 to leaf8 description: spine1 Ethernet8 to leaf8
interface: ["spine1", "Ethernet8"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine1"]
name: Ethernet8
# ============================================================ # ============================================================
# Spine2 P2P underlay — /31 # Spine2 P2P underlay — /31
# ============================================================ # ============================================================
- address: "10.0.2.0/31" - address: "10.0.2.0/31"
description: spine2 Ethernet1 to leaf1 description: spine2 Ethernet1 to leaf1
interface: ["spine2", "Ethernet1"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine2"]
name: Ethernet1
- address: "10.0.2.2/31" - address: "10.0.2.2/31"
description: spine2 Ethernet2 to leaf2 description: spine2 Ethernet2 to leaf2
interface: ["spine2", "Ethernet2"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine2"]
name: Ethernet2
- address: "10.0.2.4/31" - address: "10.0.2.4/31"
description: spine2 Ethernet3 to leaf3 description: spine2 Ethernet3 to leaf3
interface: ["spine2", "Ethernet3"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine2"]
name: Ethernet3
- address: "10.0.2.6/31" - address: "10.0.2.6/31"
description: spine2 Ethernet4 to leaf4 description: spine2 Ethernet4 to leaf4
interface: ["spine2", "Ethernet4"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine2"]
name: Ethernet4
- address: "10.0.2.8/31" - address: "10.0.2.8/31"
description: spine2 Ethernet5 to leaf5 description: spine2 Ethernet5 to leaf5
interface: ["spine2", "Ethernet5"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine2"]
name: Ethernet5
- address: "10.0.2.10/31" - address: "10.0.2.10/31"
description: spine2 Ethernet6 to leaf6 description: spine2 Ethernet6 to leaf6
interface: ["spine2", "Ethernet6"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine2"]
name: Ethernet6
- address: "10.0.2.12/31" - address: "10.0.2.12/31"
description: spine2 Ethernet7 to leaf7 description: spine2 Ethernet7 to leaf7
interface: ["spine2", "Ethernet7"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine2"]
name: Ethernet7
- address: "10.0.2.14/31" - address: "10.0.2.14/31"
description: spine2 Ethernet8 to leaf8 description: spine2 Ethernet8 to leaf8
interface: ["spine2", "Ethernet8"] interface:
kind: InfraInterfaceEthernet
data:
device: ["spine2"]
name: Ethernet8
# ============================================================ # ============================================================
# Leaf P2P underlay (leaf side) — /31 # Leaf P2P underlay (leaf side) — /31
# ============================================================ # ============================================================
# Leaf1 # Leaf1
- address: "10.0.1.1/31" - address: "10.0.1.1/31"
description: leaf1 Ethernet11 to spine1 description: leaf1 Ethernet11 to spine1
interface: ["leaf1", "Ethernet11"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf1"]
name: Ethernet11
- address: "10.0.2.1/31" - address: "10.0.2.1/31"
description: leaf1 Ethernet12 to spine2 description: leaf1 Ethernet12 to spine2
interface: ["leaf1", "Ethernet12"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf1"]
name: Ethernet12
# Leaf2 # Leaf2
- address: "10.0.1.3/31" - address: "10.0.1.3/31"
description: leaf2 Ethernet11 to spine1 description: leaf2 Ethernet11 to spine1
interface: ["leaf2", "Ethernet11"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf2"]
name: Ethernet11
- address: "10.0.2.3/31" - address: "10.0.2.3/31"
description: leaf2 Ethernet12 to spine2 description: leaf2 Ethernet12 to spine2
interface: ["leaf2", "Ethernet12"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf2"]
name: Ethernet12
# Leaf3 # Leaf3
- address: "10.0.1.5/31" - address: "10.0.1.5/31"
description: leaf3 Ethernet11 to spine1 description: leaf3 Ethernet11 to spine1
interface: ["leaf3", "Ethernet11"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf3"]
name: Ethernet11
- address: "10.0.2.5/31" - address: "10.0.2.5/31"
description: leaf3 Ethernet12 to spine2 description: leaf3 Ethernet12 to spine2
interface: ["leaf3", "Ethernet12"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf3"]
name: Ethernet12
# Leaf4 # Leaf4
- address: "10.0.1.7/31" - address: "10.0.1.7/31"
description: leaf4 Ethernet11 to spine1 description: leaf4 Ethernet11 to spine1
interface: ["leaf4", "Ethernet11"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf4"]
name: Ethernet11
- address: "10.0.2.7/31" - address: "10.0.2.7/31"
description: leaf4 Ethernet12 to spine2 description: leaf4 Ethernet12 to spine2
interface: ["leaf4", "Ethernet12"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf4"]
name: Ethernet12
# Leaf5 # Leaf5
- address: "10.0.1.9/31" - address: "10.0.1.9/31"
description: leaf5 Ethernet11 to spine1 description: leaf5 Ethernet11 to spine1
interface: ["leaf5", "Ethernet11"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf5"]
name: Ethernet11
- address: "10.0.2.9/31" - address: "10.0.2.9/31"
description: leaf5 Ethernet12 to spine2 description: leaf5 Ethernet12 to spine2
interface: ["leaf5", "Ethernet12"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf5"]
name: Ethernet12
# Leaf6 # Leaf6
- address: "10.0.1.11/31" - address: "10.0.1.11/31"
description: leaf6 Ethernet11 to spine1 description: leaf6 Ethernet11 to spine1
interface: ["leaf6", "Ethernet11"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf6"]
name: Ethernet11
- address: "10.0.2.11/31" - address: "10.0.2.11/31"
description: leaf6 Ethernet12 to spine2 description: leaf6 Ethernet12 to spine2
interface: ["leaf6", "Ethernet12"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf6"]
name: Ethernet12
# Leaf7 # Leaf7
- address: "10.0.1.13/31" - address: "10.0.1.13/31"
description: leaf7 Ethernet11 to spine1 description: leaf7 Ethernet11 to spine1
interface: ["leaf7", "Ethernet11"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf7"]
name: Ethernet11
- address: "10.0.2.13/31" - address: "10.0.2.13/31"
description: leaf7 Ethernet12 to spine2 description: leaf7 Ethernet12 to spine2
interface: ["leaf7", "Ethernet12"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf7"]
name: Ethernet12
# Leaf8 # Leaf8
- address: "10.0.1.15/31" - address: "10.0.1.15/31"
description: leaf8 Ethernet11 to spine1 description: leaf8 Ethernet11 to spine1
interface: ["leaf8", "Ethernet11"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf8"]
name: Ethernet11
- address: "10.0.2.15/31" - address: "10.0.2.15/31"
description: leaf8 Ethernet12 to spine2 description: leaf8 Ethernet12 to spine2
interface: ["leaf8", "Ethernet12"] interface:
kind: InfraInterfaceEthernet
data:
device: ["leaf8"]
name: Ethernet12

View File

@@ -11,76 +11,164 @@ spec:
# ============================================================ # ============================================================
- address: "10.0.199.254/31" - address: "10.0.199.254/31"
description: leaf1 MLAG peer-link description: leaf1 MLAG peer-link
interface: ["leaf1", "Vlan4090"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf1"]
name: Vlan4090
- address: "10.0.199.255/31" - address: "10.0.199.255/31"
description: leaf2 MLAG peer-link description: leaf2 MLAG peer-link
interface: ["leaf2", "Vlan4090"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf2"]
name: Vlan4090
- address: "10.0.199.252/31" - address: "10.0.199.252/31"
description: leaf3 MLAG peer-link description: leaf3 MLAG peer-link
interface: ["leaf3", "Vlan4090"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf3"]
name: Vlan4090
- address: "10.0.199.253/31" - address: "10.0.199.253/31"
description: leaf4 MLAG peer-link description: leaf4 MLAG peer-link
interface: ["leaf4", "Vlan4090"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf4"]
name: Vlan4090
- address: "10.0.199.250/31" - address: "10.0.199.250/31"
description: leaf5 MLAG peer-link description: leaf5 MLAG peer-link
interface: ["leaf5", "Vlan4090"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf5"]
name: Vlan4090
- address: "10.0.199.251/31" - address: "10.0.199.251/31"
description: leaf6 MLAG peer-link description: leaf6 MLAG peer-link
interface: ["leaf6", "Vlan4090"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf6"]
name: Vlan4090
- address: "10.0.199.248/31" - address: "10.0.199.248/31"
description: leaf7 MLAG peer-link description: leaf7 MLAG peer-link
interface: ["leaf7", "Vlan4090"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf7"]
name: Vlan4090
- address: "10.0.199.249/31" - address: "10.0.199.249/31"
description: leaf8 MLAG peer-link description: leaf8 MLAG peer-link
interface: ["leaf8", "Vlan4090"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf8"]
name: Vlan4090
# ============================================================ # ============================================================
# MLAG iBGP Peering SVI (Vlan4091) — /31 # MLAG iBGP Peering SVI (Vlan4091) — /31
# ============================================================ # ============================================================
- address: "10.0.3.0/31" - address: "10.0.3.0/31"
description: leaf1 MLAG iBGP peering description: leaf1 MLAG iBGP peering
interface: ["leaf1", "Vlan4091"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf1"]
name: Vlan4091
- address: "10.0.3.1/31" - address: "10.0.3.1/31"
description: leaf2 MLAG iBGP peering description: leaf2 MLAG iBGP peering
interface: ["leaf2", "Vlan4091"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf2"]
name: Vlan4091
- address: "10.0.3.2/31" - address: "10.0.3.2/31"
description: leaf3 MLAG iBGP peering description: leaf3 MLAG iBGP peering
interface: ["leaf3", "Vlan4091"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf3"]
name: Vlan4091
- address: "10.0.3.3/31" - address: "10.0.3.3/31"
description: leaf4 MLAG iBGP peering description: leaf4 MLAG iBGP peering
interface: ["leaf4", "Vlan4091"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf4"]
name: Vlan4091
- address: "10.0.3.4/31" - address: "10.0.3.4/31"
description: leaf5 MLAG iBGP peering description: leaf5 MLAG iBGP peering
interface: ["leaf5", "Vlan4091"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf5"]
name: Vlan4091
- address: "10.0.3.5/31" - address: "10.0.3.5/31"
description: leaf6 MLAG iBGP peering description: leaf6 MLAG iBGP peering
interface: ["leaf6", "Vlan4091"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf6"]
name: Vlan4091
- address: "10.0.3.6/31" - address: "10.0.3.6/31"
description: leaf7 MLAG iBGP peering description: leaf7 MLAG iBGP peering
interface: ["leaf7", "Vlan4091"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf7"]
name: Vlan4091
- address: "10.0.3.7/31" - address: "10.0.3.7/31"
description: leaf8 MLAG iBGP peering description: leaf8 MLAG iBGP peering
interface: ["leaf8", "Vlan4091"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf8"]
name: Vlan4091
# ============================================================ # ============================================================
# VRF gold SVI addresses — /24 # VRF gold SVI addresses — /24
# ============================================================ # ============================================================
# Vlan34 (leaf3/leaf4) # Vlan34 (leaf3/leaf4)
- address: "10.34.34.2/24" - address: "10.34.34.2/24"
description: leaf3 Vlan34 VRF gold description: leaf3 Vlan34 VRF gold
interface: ["leaf3", "Vlan34"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf3"]
name: Vlan34
- address: "10.34.34.3/24" - address: "10.34.34.3/24"
description: leaf4 Vlan34 VRF gold description: leaf4 Vlan34 VRF gold
interface: ["leaf4", "Vlan34"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf4"]
name: Vlan34
# Vlan78 (leaf7/leaf8) # Vlan78 (leaf7/leaf8)
- address: "10.78.78.2/24" - address: "10.78.78.2/24"
description: leaf7 Vlan78 VRF gold description: leaf7 Vlan78 VRF gold
interface: ["leaf7", "Vlan78"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf7"]
name: Vlan78
- address: "10.78.78.3/24" - address: "10.78.78.3/24"
description: leaf8 Vlan78 VRF gold description: leaf8 Vlan78 VRF gold
interface: ["leaf8", "Vlan78"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf8"]
name: Vlan78
# Vlan900 — BGP border (leaf7/leaf8) # Vlan900 — BGP border (leaf7/leaf8)
- address: "10.90.90.2/29" - address: "10.90.90.2/29"
description: leaf7 Vlan900 BGP border description: leaf7 Vlan900 BGP border
interface: ["leaf7", "Vlan900"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf7"]
name: Vlan900
- address: "10.90.90.3/29" - address: "10.90.90.3/29"
description: leaf8 Vlan900 BGP border description: leaf8 Vlan900 BGP border
interface: ["leaf8", "Vlan900"] interface:
kind: InfraInterfaceVlan
data:
device: ["leaf8"]
name: Vlan900