Skip to content

Commit 89b4aad

Browse files
committed
docs: adopt latest changes
1 parent e4c6405 commit 89b4aad

File tree

3 files changed

+9
-69
lines changed

3 files changed

+9
-69
lines changed

DEVELOPMENT.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ Next install our CAPMS provider into the cluster.
1818
make push-to-capi-lab
1919
```
2020

21-
Before creating a cluster some manual steps are required beforehand: you need to allocate a node network.
21+
Before creating a cluster the control plane IP needs to be created first:
2222

2323
```bash
24-
make -C capi-lab node-network control-plane-ip
24+
make -C capi-lab control-plane-ip
2525
```
2626

27-
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.
27+
A basic cluster configuration that relies on `config/clusterctl-templates/cluster-template-calico.yaml` and uses the aforementioned IP can be generated and applied to the management cluster using a make target.
2828

2929
```bash
3030
make -C capi-lab apply-sample-cluster
@@ -159,7 +159,6 @@ export METAL_API_URL=
159159

160160
export METAL_PARTITION=
161161
export METAL_PROJECT_ID=
162-
export METAL_NODE_NETWORK_ID=
163162
export CONTROL_PLANE_IP=
164163

165164
export FIREWALL_MACHINE_IMAGE=
@@ -183,11 +182,10 @@ export project_name=
183182
export tenant_name=
184183
```
185184

186-
Create project, node network and control plane ip if needed:
185+
Create project and control plane ip if needed:
187186

188187
```bash
189188
metalctl project create --name $project_name --tenant $tenant_name --description "Cluster API test project"
190-
metalctl network allocate --description "Node network for $CLUSTER_NAME" --name $CLUSTER_NAME --project $METAL_PROJECT_ID --partition $METAL_PARTITION
191189
metalctl network ip create --network internet --project $METAL_PROJECT_ID --name "$CLUSTER_NAME-vip" --type static -o template --template "{{ .ipaddress }}"
192190
```
193191

README.md

Lines changed: 5 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Currently, we provide the following custom resources:
1717

1818
We plan to cover more resources in the future:
1919

20-
- Node Networks
2120
- Complete Firewall Deployments using the [Firewall Controller Manager](https://github.com/metal-stack/firewall-controller-manager)
2221
- Improved configuration suggestion of CNIs
2322

@@ -62,28 +61,21 @@ clusterctl init --infrastructure metal-stack
6261
> **Manual steps needed:**
6362
> Due to the early development stage, manual actions are needed for the cluster to operate. Some metal-stack resources need to be created manually.
6463
65-
A node network needs to be created.
64+
Allocate a VIP for the control plane.
65+
6666
```bash
6767
export CLUSTER_NAME=<cluster-name>
6868
export METAL_PARTITION=<partition>
6969
export METAL_PROJECT_ID=<project-id>
70-
metalctl network allocate --description "Node network for $CLUSTER_NAME" --name $CLUSTER_NAME --project $METAL_PROJECT_ID --partition $METAL_PARTITION
7170

72-
# export environment variable for use in the next steps
73-
export METAL_NODE_NETWORK_ID=$(metalctl network list --name $CLUSTER_NAME -o template --template '{{ .id }}')
74-
```
75-
76-
Allocate a VIP for the control plane.
77-
78-
```bash
7971
export CONTROL_PLANE_IP=$(metalctl network ip create --network internet --project $METAL_PROJECT_ID --name "$CLUSTER_NAME-vip" --type static -o template --template "{{ .ipaddress }}")
8072
```
8173

8274
For your first cluster, it is advised to start with our generated template. Ensure that the namespaced cluster name is unique within the metal stack project.
8375

8476
```bash
8577
# display required environment variables
86-
clusterctl generate cluster $CLUSTER_NAME --infrastructure metal-stack --list-variables
78+
clusterctl generate cluster $CLUSTER_NAME --infrastructure metal-stack --list-variables --flavor calico
8779

8880
# set additional environment variables
8981
export CONTROL_PLANE_MACHINE_IMAGE=<machine-image>
@@ -94,7 +86,7 @@ export FIREWALL_MACHINE_IMAGE=<machine-image>
9486
export FIREWALL_MACHINE_SIZE=<machine-size>
9587

9688
# generate manifest
97-
clusterctl generate cluster $CLUSTER_NAME --kubernetes-version v1.32.9 --infrastructure metal-stack
89+
clusterctl generate cluster $CLUSTER_NAME --kubernetes-version v1.32.9 --infrastructure metal-stack --flavor calico
9890
```
9991

10092
Apply the generated manifest from the `clusterctl` output.
@@ -103,51 +95,7 @@ Apply the generated manifest from the `clusterctl` output.
10395
kubectl apply -f <manifest>
10496
```
10597

106-
Once your control plane and worker machines have been provisioned, you need to install your CNI of choice into your created cluster. This is required due to CAPI. An example is provided below:
107-
108-
```bash
109-
# get the kubeconfig
110-
clusterctl get kubeconfig metal-test > capms-cluster.kubeconfig
111-
112-
# install the calico operator
113-
kubectl --kubeconfig=capms-cluster.kubeconfig create -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.2/manifests/tigera-operator.yaml
114-
115-
# install the calico CNI
116-
cat <<EOF | kubectl --kubeconfig=capms-cluster.kubeconfig create -f -
117-
apiVersion: operator.tigera.io/v1
118-
kind: Installation
119-
metadata:
120-
name: default
121-
spec:
122-
# Configures Calico networking.
123-
calicoNetwork:
124-
bgp: Disabled
125-
ipPools:
126-
- name: default-ipv4-ippool
127-
blockSize: 26
128-
cidr: 10.240.0.0/12
129-
encapsulation: None
130-
mtu: 1440
131-
cni:
132-
ipam:
133-
type: HostLocal
134-
type: Calico
135-
EOF
136-
```
137-
138-
Meanwhile, the `metal-ccm` has to be deployed for the machines to reach `Running` phase. For this use the [`config/target-cluster/metal-ccm.yaml` template](config/target-cluster/metal-ccm.yaml) and fill in the required variables.
139-
140-
```bash
141-
export NAMESPACE=<namespace>
142-
export CLUSTER_NAME=<cluster name>
143-
cat config/target-cluster/metal-ccm.yaml | envsubst | kubectl --kubeconfig capms-cluster.kubeconfig apply -f -
144-
```
145-
146-
If you want to provide service's of type `LoadBalancer` through MetalLB by the `metal-ccm`, you need to deploy MetalLB:
147-
148-
```bash
149-
kubectl --kubeconfig capms-cluster.kubeconfig apply --kustomize capi-lab/metallb
150-
```
98+
That's it!
15199

152100
## Frequently Asked Questions
153101

capi-lab/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,12 @@ controller:
5959
kubectl --kubeconfig=$(KUBECONFIG) patch deployments.apps -n cap-metal-stack metal-stack-controller-manager --patch='{"spec":{"template":{"spec":{"containers":[{"name": "manager","imagePullPolicy":"IfNotPresent","image":"$(IMG)"}]}}}}'
6060
kubectl --kubeconfig=$(KUBECONFIG) delete pod -n cap-metal-stack -l control-plane=metal-stack-controller-manager
6161

62-
.PHONY: node-network
63-
node-network:
64-
metalctl network allocate --description "node network for $(CLUSTER_NAME) cluster" --name $(CLUSTER_NAME) --project 00000000-0000-0000-0000-000000000001 --partition mini-lab
65-
6662
.PHONY: control-plane-ip
6763
control-plane-ip:
6864
metalctl network ip create --network internet-mini-lab --project $(METAL_PROJECT_ID) --name "$(CLUSTER_NAME)-vip" --type static -o template --template "{{ .ipaddress }}"
6965

7066
.PHONY: apply-sample-cluster
7167
apply-sample-cluster:
72-
$(eval METAL_NODE_NETWORK_ID = $(shell metalctl network list --name $(CLUSTER_NAME) -o template --template '{{ .id }}'))
7368
$(eval CONTROL_PLANE_IP = $(shell metalctl network ip list --name "$(CLUSTER_NAME)-vip" -o template --template '{{ .ipaddress }}'))
7469
echo $(CLUSTER_NAME)
7570
clusterctl generate cluster $(CLUSTER_NAME) \
@@ -82,7 +77,6 @@ apply-sample-cluster:
8277

8378
.PHONY: delete-sample-cluster
8479
delete-sample-cluster:
85-
$(eval METAL_NODE_NETWORK_ID = $(shell metalctl network list --name $(CLUSTER_NAME) -o template --template '{{ .id }}'))
8680
$(eval CONTROL_PLANE_IP = $(shell metalctl network ip list --name "$(CLUSTER_NAME)-vip" -o template --template '{{ .ipaddress }}'))
8781
clusterctl generate cluster $(CLUSTER_NAME) \
8882
--kubeconfig=$(KUBECONFIG) \

0 commit comments

Comments
 (0)