Skip to content

Commit e833592

Browse files
committed
docs: adopt latest changes
1 parent 4fa520d commit e833592

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
@@ -14,7 +14,6 @@ Currently, we provide the following custom resources:
1414

1515
We plan to cover more resources in the future:
1616

17-
- Node Networks
1817
- Complete Firewall Deployments using the [Firewall Controller Manager](https://github.com/metal-stack/firewall-controller-manager)
1918
- Improved configuration suggestion of CNIs
2019

@@ -59,28 +58,21 @@ clusterctl init --infrastructure metal-stack
5958
> **Manual steps needed:**
6059
> Due to the early development stage, manual actions are needed for the cluster to operate. Some metal-stack resources need to be created manually.
6160
62-
A node network needs to be created.
61+
Allocate a VIP for the control plane.
62+
6363
```bash
6464
export CLUSTER_NAME=<cluster-name>
6565
export METAL_PARTITION=<partition>
6666
export METAL_PROJECT_ID=<project-id>
67-
metalctl network allocate --description "Node network for $CLUSTER_NAME" --name $CLUSTER_NAME --project $METAL_PROJECT_ID --partition $METAL_PARTITION
6867

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

7971
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.
8072

8173
```bash
8274
# display required environment variables
83-
clusterctl generate cluster $CLUSTER_NAME --infrastructure metal-stack --list-variables
75+
clusterctl generate cluster $CLUSTER_NAME --infrastructure metal-stack --list-variables --flavor calico
8476

8577
# set additional environment variables
8678
export CONTROL_PLANE_MACHINE_IMAGE=<machine-image>
@@ -91,7 +83,7 @@ export FIREWALL_MACHINE_IMAGE=<machine-image>
9183
export FIREWALL_MACHINE_SIZE=<machine-size>
9284

9385
# generate manifest
94-
clusterctl generate cluster $CLUSTER_NAME --kubernetes-version v1.32.9 --infrastructure metal-stack
86+
clusterctl generate cluster $CLUSTER_NAME --kubernetes-version v1.32.9 --infrastructure metal-stack --flavor calico
9587
```
9688

9789
Apply the generated manifest from the `clusterctl` output.
@@ -100,51 +92,7 @@ Apply the generated manifest from the `clusterctl` output.
10092
kubectl apply -f <manifest>
10193
```
10294

103-
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:
104-
105-
```bash
106-
# get the kubeconfig
107-
clusterctl get kubeconfig metal-test > capms-cluster.kubeconfig
108-
109-
# install the calico operator
110-
kubectl --kubeconfig=capms-cluster.kubeconfig create -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.2/manifests/tigera-operator.yaml
111-
112-
# install the calico CNI
113-
cat <<EOF | kubectl --kubeconfig=capms-cluster.kubeconfig create -f -
114-
apiVersion: operator.tigera.io/v1
115-
kind: Installation
116-
metadata:
117-
name: default
118-
spec:
119-
# Configures Calico networking.
120-
calicoNetwork:
121-
bgp: Disabled
122-
ipPools:
123-
- name: default-ipv4-ippool
124-
blockSize: 26
125-
cidr: 10.240.0.0/12
126-
encapsulation: None
127-
mtu: 1440
128-
cni:
129-
ipam:
130-
type: HostLocal
131-
type: Calico
132-
EOF
133-
```
134-
135-
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.
136-
137-
```bash
138-
export NAMESPACE=<namespace>
139-
export CLUSTER_NAME=<cluster name>
140-
cat config/target-cluster/metal-ccm.yaml | envsubst | kubectl --kubeconfig capms-cluster.kubeconfig apply -f -
141-
```
142-
143-
If you want to provide service's of type `LoadBalancer` through MetalLB by the `metal-ccm`, you need to deploy MetalLB:
144-
145-
```bash
146-
kubectl --kubeconfig capms-cluster.kubeconfig apply --kustomize capi-lab/metallb
147-
```
95+
That's it!
14896

14997
## Frequently Asked Questions
15098

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)