Skip to content
Draft
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
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand 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 \
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
82 changes: 82 additions & 0 deletions mini-lab.capms.sonic.yaml
Original file line number Diff line number Diff line change
@@ -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"]
Loading