Skip to content

Commit 4d5db33

Browse files
Jonathan D.A. Jewellclaude
andcommitted
feat: add FlatRacoon manifest, containerlab topology, and K8s job
Add bgp-backbone-lab.manifest.ncl for orchestrator module discovery. Create minimal 3-router eBGP topology (spine + 2 leaves) using FRRouting. Add K8s Job manifest for in-cluster containerlab deployment. Update justfile with deploy/destroy recipes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bf3ee2f commit 4d5db33

4 files changed

Lines changed: 147 additions & 5 deletions

File tree

bgp-backbone-lab.manifest.ncl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# bgp-backbone-lab module manifest for FlatRacoon orchestrator
3+
4+
{
5+
name = "bgp-backbone-lab",
6+
version = "0.1.0",
7+
layer = 'network,
8+
description = "BGP backbone lab with containerlab topology for eBGP peering simulation using FRRouting",
9+
repo = "github.com/hyperpolymath/bgp-backbone-lab",
10+
requires = ["containerlab"],
11+
provides = ["bgp-peering", "backbone-routing", "route-reflection"],
12+
config_schema = "configs/schema.ncl",
13+
health_endpoint = null,
14+
metrics_endpoint = null,
15+
deployment_mode = "kubectl",
16+
namespace = "bgp-lab",
17+
}

justfile

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
1-
# SPDX-License-Identifier: PMPL-1.0
2-
# Justfile - hyperpolymath standard task runner
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Justfile - BGP backbone lab deployment automation
33

44
default:
55
@just --list
66

7-
# Build the project
7+
# Deploy BGP lab topology via containerlab
8+
deploy:
9+
@echo "Deploying BGP backbone lab..."
10+
containerlab deploy --topo topologies/flatracoon-bgp.clab.yml
11+
@echo "BGP lab deployed"
12+
13+
# Destroy BGP lab topology
14+
destroy:
15+
@echo "Destroying BGP backbone lab..."
16+
containerlab destroy --topo topologies/flatracoon-bgp.clab.yml
17+
@echo "BGP lab destroyed"
18+
19+
# Deploy via K8s Job (for in-cluster deployment)
20+
deploy-k8s:
21+
kubectl apply -f manifests/containerlab-job.yaml
22+
@echo "K8s containerlab job submitted"
23+
24+
# Show topology status
25+
status:
26+
containerlab inspect --topo topologies/flatracoon-bgp.clab.yml 2>/dev/null || echo "Not deployed"
27+
28+
# Build the project (ABI/FFI compilation)
829
build:
9-
@echo "Building..."
30+
@echo "Building ABI definitions..."
1031

1132
# Run tests
1233
test:
@@ -30,4 +51,3 @@ check: lint test
3051
# Prepare a release
3152
release VERSION:
3253
@echo "Releasing {{VERSION}}..."
33-

manifests/containerlab-job.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# K8s Job to deploy the containerlab BGP topology
3+
apiVersion: batch/v1
4+
kind: Job
5+
metadata:
6+
name: bgp-lab-deploy
7+
namespace: bgp-lab
8+
labels:
9+
app.kubernetes.io/name: bgp-backbone-lab
10+
app.kubernetes.io/component: topology-deployer
11+
app.kubernetes.io/part-of: flatracoon
12+
spec:
13+
backoffLimit: 3
14+
ttlSecondsAfterFinished: 3600
15+
template:
16+
metadata:
17+
labels:
18+
app.kubernetes.io/name: bgp-backbone-lab
19+
spec:
20+
restartPolicy: Never
21+
serviceAccountName: containerlab-runner
22+
containers:
23+
- name: containerlab
24+
image: ghcr.io/srl-labs/containerlab:latest
25+
command:
26+
- containerlab
27+
- deploy
28+
- --topo
29+
- /topology/flatracoon-bgp.clab.yml
30+
volumeMounts:
31+
- name: topology
32+
mountPath: /topology
33+
readOnly: true
34+
- name: docker-sock
35+
mountPath: /var/run/docker.sock
36+
securityContext:
37+
privileged: true
38+
volumes:
39+
- name: topology
40+
configMap:
41+
name: bgp-topology
42+
- name: docker-sock
43+
hostPath:
44+
path: /var/run/docker.sock
45+
type: Socket
46+
---
47+
apiVersion: v1
48+
kind: Namespace
49+
metadata:
50+
name: bgp-lab
51+
labels:
52+
app.kubernetes.io/part-of: flatracoon
53+
---
54+
apiVersion: v1
55+
kind: ServiceAccount
56+
metadata:
57+
name: containerlab-runner
58+
namespace: bgp-lab

topologies/flatracoon-bgp.clab.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# FlatRacoon BGP backbone lab - minimal 3-router eBGP topology
3+
# Spine + 2 leaf routers using FRRouting
4+
5+
name: flatracoon-bgp
6+
7+
topology:
8+
nodes:
9+
spine:
10+
kind: linux
11+
image: frrouting/frr:latest
12+
env:
13+
FRR_DEFAULTS: traditional
14+
binds:
15+
- configs/spine-frr.conf:/etc/frr/frr.conf
16+
exec:
17+
- ip addr add 10.0.1.1/30 dev eth1
18+
- ip addr add 10.0.2.1/30 dev eth2
19+
- ip addr add fd00:bgp::1/128 dev lo
20+
21+
leaf1:
22+
kind: linux
23+
image: frrouting/frr:latest
24+
env:
25+
FRR_DEFAULTS: traditional
26+
binds:
27+
- configs/leaf1-frr.conf:/etc/frr/frr.conf
28+
exec:
29+
- ip addr add 10.0.1.2/30 dev eth1
30+
- ip addr add 172.16.1.1/24 dev eth2
31+
- ip addr add fd00:bgp::2/128 dev lo
32+
33+
leaf2:
34+
kind: linux
35+
image: frrouting/frr:latest
36+
env:
37+
FRR_DEFAULTS: traditional
38+
binds:
39+
- configs/leaf2-frr.conf:/etc/frr/frr.conf
40+
exec:
41+
- ip addr add 10.0.2.2/30 dev eth1
42+
- ip addr add 172.16.2.1/24 dev eth2
43+
- ip addr add fd00:bgp::3/128 dev lo
44+
45+
links:
46+
- endpoints: ["spine:eth1", "leaf1:eth1"]
47+
- endpoints: ["spine:eth2", "leaf2:eth1"]

0 commit comments

Comments
 (0)