From f29e42bd86a21f1e8bb1c5564b40d627d2fee148 Mon Sep 17 00:00:00 2001 From: Matthias Hartmann Date: Thu, 21 May 2026 10:47:40 +0200 Subject: [PATCH] feat: re-introduce capms sonic flavor --- Makefile | 3 ++ README.md | 1 + mini-lab.capms.sonic.yaml | 82 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 mini-lab.capms.sonic.yaml diff --git a/Makefile b/Makefile index 190c64a4..59648061 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,8 @@ MINI_LAB_SONIC_IMAGE=r.metal-stack.io/vrnetlab/dell_sonic:$(MINI_LAB_DELL_SONIC_ else ifeq ($(MINI_LAB_FLAVOR),capms) LAB_TOPOLOGY=mini-lab.capms.yaml MINI_LAB_SONIC_IMAGE=r.metal-stack.io/vrnetlab/dell_sonic:$(MINI_LAB_DELL_SONIC_VERSION) +else ifeq ($(MINI_LAB_FLAVOR),capms_sonic) +LAB_TOPOLOGY=mini-lab.capms.sonic.yaml else ifeq ($(MINI_LAB_FLAVOR),kamaji) LAB_TOPOLOGY=mini-lab.kamaji.yaml KAMAJI_ENABLED=true @@ -178,6 +180,7 @@ cleanup-partition: mkdir -p clab-mini-lab sudo --preserve-env $(CONTAINERLAB) destroy --topo mini-lab.dell_sonic.yaml sudo --preserve-env $(CONTAINERLAB) destroy --topo mini-lab.sonic.yaml + sudo --preserve-env $(CONTAINERLAB) destroy --topo mini-lab.capms.sonic.yaml sudo --preserve-env $(CONTAINERLAB) destroy --topo mini-lab.capms.yaml sudo --preserve-env $(CONTAINERLAB) destroy --topo mini-lab.kamaji.yaml docker network rm --force mini_lab_ext diff --git a/README.md b/README.md index 4ad787af..55eb68f9 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,7 @@ All available mini-lab flavors are listed below: - `sonic`: runs two Community SONiC switches - `dell_sonic`: runs two Enterprise SONiC switches with a [locally built vrnetlab image](https://github.com/srl-labs/vrnetlab/tree/master/dell/dell_sonic) +- `capms_sonic`: runs the `sonic` flavor but with four instead of two machines (this is used for [cluster-provider-metal-stack](https://github.com/metal-stack/cluster-api-provider-metal-stack) in order to have dedicated hosts for control plane / worker / firewall) - `capms`: runs the `dell_sonic` flavor but with four instead of two machines (this is used for [cluster-provider-metal-stack](https://github.com/metal-stack/cluster-api-provider-metal-stack) in order to have dedicated hosts for control plane / worker / firewall) - `kamaji`: runs a variation of the `sonic` flavor. The working example is available at the [cluster-provider-metal-stack](https://github.com/metal-stack/cluster-api-provider-metal-stack)'s `capi-lab`. - `gardener`: runs the `sonic` flavor and installs the [Gardener](https://gardener.cloud) in the mini-lab diff --git a/mini-lab.capms.sonic.yaml b/mini-lab.capms.sonic.yaml new file mode 100644 index 00000000..e5b704c4 --- /dev/null +++ b/mini-lab.capms.sonic.yaml @@ -0,0 +1,82 @@ +# flavor for mini-lab cluster-api-provider-metal-stack +name: mini-lab +prefix: "" + +mgmt: + network: mini_lab_ext + +topology: + defaults: + kind: linux + nodes: + metal-control-plane-control-plane: + kind: ext-container + exec: + - ip route add 203.0.113.128/25 via 203.0.113.128 dev eth0 + exit: + image: quay.io/frrouting/frr:10.3.0 + network-mode: none + binds: + - files/exit/daemons:/etc/frr/daemons + - files/exit/frr.conf:/etc/frr/frr.conf + - files/exit/vtysh.conf:/etc/frr/vtysh.conf + - files/exit/network.sh:/root/network.sh + exec: + - sh /root/network.sh + mini_lab_ext: + kind: bridge + leaf01: + group: leaves + image: ${MINI_LAB_SONIC_IMAGE} + binds: + - files/ssh/id_ed25519.pub:/authorized_keys + env: + QEMU_MEMORY: 4096 + leaf02: + group: leaves + image: ${MINI_LAB_SONIC_IMAGE} + binds: + - files/ssh/id_ed25519.pub:/authorized_keys + env: + QEMU_MEMORY: 4096 + machine01: + group: machines + image: ${MINI_LAB_VM_IMAGE} + env: + QEMU_CPU_CORES: 2 + QEMU_DISK_SIZE: 20G + UUID: 00000000-0000-0000-0000-000000000001 + machine02: + group: machines + image: ${MINI_LAB_VM_IMAGE} + env: + QEMU_CPU_CORES: 2 + QEMU_DISK_SIZE: 20G + UUID: 00000000-0000-0000-0000-000000000002 + machine03: + group: machines + image: ${MINI_LAB_VM_IMAGE} + env: + QEMU_CPU_CORES: 2 + QEMU_DISK_SIZE: 20G + UUID: 00000000-0000-0000-0000-000000000003 + machine04: + group: machines + image: ${MINI_LAB_VM_IMAGE} + env: + QEMU_CPU_CORES: 2 + QEMU_DISK_SIZE: 20G + UUID: 00000000-0000-0000-0000-000000000004 + links: + - endpoints: ["exit:mini_lab_ext", "mini_lab_ext:exit"] + mtu: 9000 + - endpoints: ["leaf01:Ethernet0", "machine01:lan0"] + - endpoints: ["leaf02:Ethernet0", "machine01:lan1"] + - endpoints: ["leaf01:Ethernet1", "machine02:lan0"] + - endpoints: ["leaf02:Ethernet1", "machine02:lan1"] + - endpoints: ["leaf01:Ethernet2", "machine03:lan0"] + - endpoints: ["leaf02:Ethernet2", "machine03:lan1"] + - endpoints: ["leaf01:Ethernet3", "machine04:lan0"] + - endpoints: ["leaf02:Ethernet3", "machine04:lan1"] + - endpoints: ["leaf01:Ethernet120", "exit:eth1"] + - endpoints: ["leaf02:Ethernet120", "exit:eth2"]