-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
215 lines (188 loc) · 7 KB
/
Copy pathTaskfile.yaml
File metadata and controls
215 lines (188 loc) · 7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
version: '3'
vars:
LAB:
sh: awk '/^name:/ {print $2; exit}' *.clab.yaml
TOPO:
sh: echo *.clab.yaml
FRR_VERSION: "10.6.1"
FRR_IMAGE: frr:{{.FRR_VERSION}}
COSMOS_IMAGE: cosmos:latest
tasks:
default:
silent: true
cmds:
- task --list
build:
desc: Build all container images
cmds:
- task: "clone:cosmos"
- task: "build:node"
- task: "build:frr"
- task: "build:galactic-agent"
- task: "build:cosmos"
"clone:cosmos":
desc: Clone the cosmos source tree needed for go mod replace and image build
status:
- test -d build/cosmos
cmds:
- git clone --depth=1 https://github.com/milo-os/cosmos build/cosmos
"build:node":
desc: Build the Kind node image with the galactic CNI plugin
deps: ["clone:cosmos"]
cmds:
- docker build --network=host -t kindest/node:galactic -f containers/kindest-node-galactic/Dockerfile ../..
"build:frr":
desc: Build the FRR container from Alpine edge (v{{.FRR_VERSION}})
status:
- docker image inspect {{.FRR_IMAGE}} > /dev/null 2>&1
cmds:
- docker build --build-arg FRR_VERSION={{.FRR_VERSION}} -t {{.FRR_IMAGE}} containers/frr/
"build:galactic-agent":
desc: Build the galactic-agent container image
cmds:
- docker build --network=host -t galactic-agent:latest -f containers/galactic-agent/Dockerfile ../..
"build:cosmos":
desc: Build the cosmos operator container image from the local clone
deps: ["clone:cosmos"]
cmds:
- docker build --network=host -t {{.COSMOS_IMAGE}} -f build/cosmos/build/Dockerfile build/cosmos
deploy:
desc: Build images and deploy the full lab end-to-end
deps: [build, host-setup]
cmds:
- task: "deploy:clusters"
- task: "deploy:topology"
- task: "deploy:rename-rr"
- task: "deploy:images"
- task: "deploy:underlay"
- task: "deploy:overlay"
"deploy:clusters":
desc: Create Kind clusters (sequential to avoid kubeadm contention during parallel clab deploy)
cmds:
- kind create cluster --name dfw --config node_files/dfw/config.yaml --image kindest/node:galactic
- kind create cluster --name sjc --config node_files/sjc/config.yaml --image kindest/node:galactic
- kind create cluster --name iad --config node_files/iad/config.yaml --image kindest/node:galactic
- kind export kubeconfig --name dfw --kubeconfig dfw.kubeconfig
- kind export kubeconfig --name sjc --kubeconfig sjc.kubeconfig
- kind export kubeconfig --name iad --kubeconfig iad.kubeconfig
"deploy:topology":
desc: Deploy the ContainerLab topology (transit routers + ext-container wiring)
cmds:
- sudo containerlab deploy -t {{.TOPO}}
"deploy:rename-rr":
desc: Rename iad-worker2 to iad-worker-rr (kind does not support custom worker node names)
cmds:
- docker rename iad-worker2 iad-worker-rr
"load-image":
internal: true
desc: Load a docker image into a kind node via ctr (workaround for containerd v2 incompatibility)
requires:
vars: [IMAGE, NODE]
cmds:
- docker save {{.IMAGE}} | docker exec -i {{.NODE}} ctr --namespace k8s.io images import -
"deploy:images":
desc: Load all container images into the Kind clusters
cmds:
- task: load-image
vars: {IMAGE: "{{.FRR_IMAGE}}", NODE: iad-worker}
- task: load-image
vars: {IMAGE: "{{.FRR_IMAGE}}", NODE: iad-worker-rr}
- task: load-image
vars: {IMAGE: "{{.FRR_IMAGE}}", NODE: sjc-worker}
- task: load-image
vars: {IMAGE: "{{.FRR_IMAGE}}", NODE: dfw-worker}
- task: load-image
vars: {IMAGE: galactic-agent:latest, NODE: iad-worker}
- task: load-image
vars: {IMAGE: galactic-agent:latest, NODE: iad-worker-rr}
- task: load-image
vars: {IMAGE: galactic-agent:latest, NODE: sjc-worker}
- task: load-image
vars: {IMAGE: galactic-agent:latest, NODE: dfw-worker}
- task: load-image
vars: {IMAGE: "{{.COSMOS_IMAGE}}", NODE: iad-worker}
- task: load-image
vars: {IMAGE: "{{.COSMOS_IMAGE}}", NODE: iad-worker-rr}
- task: load-image
vars: {IMAGE: "{{.COSMOS_IMAGE}}", NODE: sjc-worker}
- task: load-image
vars: {IMAGE: "{{.COSMOS_IMAGE}}", NODE: dfw-worker}
destroy:
desc: Destroy the lab
cmds:
- sudo containerlab destroy -t {{.TOPO}} --cleanup
- kind delete cluster --name dfw || true
- kind delete cluster --name sjc || true
- kind delete cluster --name iad || true
reload:
desc: Full rebuild and redeploy
cmds:
- task: destroy
- task: deploy
inspect:
desc: Inspect deployed nodes and management addresses
cmds:
- sudo containerlab inspect -t {{.TOPO}}
graph:
desc: Generate a draw.io diagram for the current topology
cmds:
- sudo containerlab graph -t {{.TOPO}} --drawio --drawio-dir .
host-setup:
desc: Apply host sysctls for this dual-stack lab
cmds:
- sudo ./scripts/host-setup.sh --no-persist
"deploy:underlay":
desc: Install the FRR underlay DaemonSets
cmds:
- ./scripts/install-underlay.sh
"deploy:overlay":
desc: Install the galactic-agent overlay DaemonSets and cosmos operator
cmds:
- ./scripts/install-overlay.sh
test:
desc: Run all verification checks
cmds:
- task: "test:bgp-transit"
- task: "test:bgp-underlay"
- task: "test:srv6"
- task: "test:evpn"
"test:bgp-transit":
desc: Verify transit router BGP sessions (iBGP full mesh)
cmds:
- |
for r in tr1 tr2 tr3 tr4; do
echo "--- $r ---"
docker exec clab-gvpc-$r vtysh -c "show bgp ipv6 unicast summary"
done
"test:bgp-underlay":
desc: Verify underlay BGP sessions on iad and sjc workers
cmds:
- |
docker exec iad-control-plane \
kubectl exec -n galactic-system ds/iad-underlay \
-- vtysh -c "show bgp ipv6 unicast summary"
- |
docker exec sjc-control-plane \
kubectl exec -n galactic-system ds/sjc-underlay \
-- vtysh -c "show bgp ipv6 unicast summary"
"test:srv6":
desc: Verify SRv6 forwarding prefixes on tr1
cmds:
- docker exec clab-gvpc-tr1 vtysh -c "show bgp ipv6 unicast 2001:db8:ff01::/48"
- docker exec clab-gvpc-tr1 vtysh -c "show bgp ipv6 unicast 2001:db8:ff02::/48"
- docker exec clab-gvpc-tr1 vtysh -c "show bgp ipv6 unicast 2001:db8:ff03::/48"
"test:evpn":
desc: Verify GoBGP EVPN neighbors and RIB on iad, sjc, and dfw via cosmos BGPProvider status
cmds:
- docker exec iad-control-plane kubectl get bgpproviders -A
- docker exec sjc-control-plane kubectl get bgpproviders -A
- docker exec dfw-control-plane kubectl get bgpproviders -A
clean:
desc: Destroy the lab and delete artifacts
cmds:
- task: destroy
- docker rmi kindest/node:galactic || true
- docker rmi galactic-agent:latest || true
- docker rmi {{.COSMOS_IMAGE}} || true
- docker rmi {{.FRR_IMAGE}} || true
- rm -rf clab-{{.LAB}} build/