diff --git a/Makefile b/Makefile index 190c64a4..fdc88ae7 100644 --- a/Makefile +++ b/Makefile @@ -36,9 +36,11 @@ MONITORING_ENABLED := $(or $(MONITORING_ENABLED),true) else ifeq ($(MINI_LAB_FLAVOR),dell_sonic) LAB_TOPOLOGY=mini-lab.dell_sonic.yaml MINI_LAB_SONIC_IMAGE=r.metal-stack.io/vrnetlab/dell_sonic:$(MINI_LAB_DELL_SONIC_VERSION) -else ifeq ($(MINI_LAB_FLAVOR),capms) -LAB_TOPOLOGY=mini-lab.capms.yaml +else ifeq ($(MINI_LAB_FLAVOR),capms_dell_sonic) +LAB_TOPOLOGY=mini-lab.capms.dell_sonic.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 @@ -86,6 +88,14 @@ up: env gen-certs control-plane-bake partition-bake ssh -F files/ssh/config leaf01 'systemctl restart metal-core' ssh -F files/ssh/config leaf02 'systemctl restart metal-core' +# for community SONiC versions > 202311 a bgp restart is needed in the virtual environment +# TODO: should be investigated and fixed if possible +ifeq ($(filter $(MINI_LAB_FLAVOR),dell_sonic capms_dell_sonic),) + sleep 15 + ssh -F files/ssh/config leaf01 'systemctl restart bgp' + ssh -F files/ssh/config leaf02 'systemctl restart bgp' +endif + .PHONY: restart restart: down up @@ -135,7 +145,7 @@ partition-bake: external_network ifeq ($(CI),true) docker pull $(MINI_LAB_SONIC_IMAGE) endif -ifneq ($(filter $(MINI_LAB_FLAVOR),dell_sonic capms),$(MINI_LAB_FLAVOR)) +ifneq ($(filter $(MINI_LAB_FLAVOR),dell_sonic capms_dell_sonic),$(MINI_LAB_FLAVOR)) docker pull $(MINI_LAB_SONIC_IMAGE) endif @if ! sudo $(CONTAINERLAB) --topo $(LAB_TOPOLOGY) inspect | grep -i leaf01 > /dev/null; then \ @@ -178,7 +188,8 @@ 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.yaml + sudo --preserve-env $(CONTAINERLAB) destroy --topo mini-lab.capms.sonic.yaml + sudo --preserve-env $(CONTAINERLAB) destroy --topo mini-lab.capms.dell_sonic.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..ea944dad 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,8 @@ 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`: 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) +- `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_dell_sonic`: 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.yaml b/mini-lab.capms.dell_sonic.yaml similarity index 100% rename from mini-lab.capms.yaml rename to mini-lab.capms.dell_sonic.yaml 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"]