Skip to content

Commit dad870e

Browse files
committed
feat: create node network
1 parent b5c7656 commit dad870e

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,21 @@ Next install our CAPMS provider into the cluster.
2222
make push-to-capi-lab
2323
```
2424

25-
A basic cluster configuration that relies on `config/clusterctl-templates/cluster-template.yaml` can be generated and applied to the management cluster using a make target.
25+
Before creating a cluster some manual steps are required beforehand: you need to allocate a node network and a firewall.
26+
27+
```bash
28+
make -C capi-lab node-network firewall
29+
```
30+
31+
A basic cluster configuration that relies on `config/clusterctl-templates/cluster-template.yaml` and uses the aforementioned node network can be generated and applied to the management cluster using a make target.
2632

2733
```bash
2834
make apply-sample-cluster
2935
```
3036

31-
For now it is required to manually create the firewall. This might be changed in the future, but for now run:
37+
Once the control plane node has phoned home, run:
3238

3339
```bash
34-
make -C capi-lab firewall
35-
# once the firewall is up run
3640
make -C capi-lab mtu-fix
3741
```
3842

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,9 @@ endef
244244

245245
# mini-lab developer environment
246246

247-
export METAL_PARTITION ?= metal-test
247+
export METAL_PARTITION ?= mini-lab
248248
export METAL_PROJECT_ID ?= 00000000-0000-0000-0000-000000000001
249+
export METAL_NODE_NETWORK_ID ?= $(shell metalctl network list --name metal-test -o template --template '{{ .id }}')
249250
export CONTROL_PLANE_ENDPOINT ?= "203.0.113.129:443"
250251
export CONTROL_PLANE_MACHINE_IMAGE ?= ubuntu-24.04
251252
export CONTROL_PLANE_MACHINE_SIZE ?= v1-small-x86

capi-lab/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ controller:
3838
firewall:
3939
metalctl firewall create --description fw --name fw --hostname fw --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image firewall-ubuntu-3.0 --size v1-small-x86 --firewall-rules-file=firewall-rules.yaml --networks internet-mini-lab,$(shell metalctl network list --name metal-test -o template --template '{{ .id }}')
4040

41+
.PHONY: node-network
42+
node-network:
43+
metalctl network allocate --description "node network for metal-test cluster" --name metal-test --project 00000000-0000-0000-0000-000000000001 --partition mini-lab
44+
4145
.PHONY: mtu-fix
4246
mtu-fix:
4347
cd mini-lab && ssh -F files/ssh/config leaf01 'ip link set dev vtep-1001 mtu 9100 && echo done'

config/clusterctl-templates/cluster-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ metadata:
2727
spec:
2828
projectID: ${METAL_PROJECT_ID}
2929
partition: ${METAL_PARTITION}
30+
nodeNetworkID: ${METAL_NODE_NETWORK_ID}
3031
---
3132
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
3233
kind: MetalStackMachineTemplate

config/clusterctl-templates/example_variables.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ export METAL_API_HMAC=metal-admin
44
export METAL_PROJECT_ID=00000000-0000-0000-0000-000000000001
55
export POD_CIDR=10.240.0.0/12
66
export METAL_PARTITION=mini-lab
7+
export METAL_NODE_NETWORK_ID=00000000-0000-0000-0000-000000000002
78

89
export FIREWALL_MACHINE_SIZE=v1-small-x86
910
export FIREWALL_MACHINE_IMAGE=
1011
export FIREWALL_NETWORKS=[internet]
1112

12-
export NODE_NETWORK_ID=00000000-0000-0000-0000-000000000002
1313
export CONTROL_PLANE_ENDPOINT=203.0.113.129:443
1414
export CONTROL_PLANE_PORT=443
1515
export CONTROL_PLANE_MACHINE_SIZE=v1-small-x86

0 commit comments

Comments
 (0)