Skip to content

Commit c6775cc

Browse files
authored
ADD Advanced setups Guide (#30)
1 parent 34b8760 commit c6775cc

File tree

4 files changed

+107
-201
lines changed

4 files changed

+107
-201
lines changed

docs/Usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ We provide the following templates:
155155
| cilium | templates/cluster-template-cilium.yaml | templates/crs/cni/cilium.yaml |
156156
| calico | templates/cluster-template-calico.yaml | templates/crs/cni/calico.yaml |
157157
| multiple-vlans | templates/cluster-template-multiple-vlans.yaml | - |
158-
| xl-nodes | templates/cluster-template-xl-nodes.yaml | - |
159158
| default | templates/cluster-template.yaml | - |
160159
160+
For more information about advanced clusters please check our [advanced setups docs](advanced-setups.md).
161161
162162
#### Flavor with Cilium CNI
163163
Before this cluster can be deployed, `cilium` needs to be configured. As a first step we

docs/advanced-setups.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
## Advanced Setups
2+
3+
To get started with CAPMOX please refer to the [Getting Started](Usage.md#quick-start) section.
4+
5+
## Multiple NICs
6+
7+
If you want to create VMs with multiple network devices,
8+
You will need to create `InClusterPool` or `GlobalInClusterPool` to manage IPs.
9+
10+
here is a `GlobalInClusterPool` example:
11+
12+
```yaml
13+
apiVersion: ipam.cluster.x-k8s.io/v1alpha2
14+
kind: GlobalInClusterIPPool
15+
metadata:
16+
name: shared-inclusterippool
17+
spec:
18+
addresses: ${NODE_SECONDARY_IP_RANGES}
19+
prefix: ${SECONDARY_IP_PREFIX}
20+
gateway: ${SECONDARY_GATEWAY}
21+
```
22+
23+
In the cluster template flavor=multiple-vlans you can define a secondary network device for the VMs.
24+
To do that you will need to set extra environment variables along with the required ones:
25+
26+
```bash
27+
# The secondary IP ranges for Cluster nodes
28+
export NODE_SECONDARY_IP_RANGES="[10.10.10.100-10.10.10.150]"
29+
# The Subnet Mask in CIDR notation for your node secondary IP ranges
30+
export SECONDARY_IP_PREFIX=24
31+
# The secondary gateway for the machines network-config
32+
export SECONDARY_GATEWAY="10.10.10.254"
33+
# The secondary dns nameservers for the machines network-config
34+
export SECONDARY_DNS_SERVERS="[8.8.8.8, 8.8.4.4]"
35+
# The Proxmox secondary network bridge for VMs
36+
export SECONDARY_BRIDGE=vmbr2
37+
```
38+
39+
#### Generate a Cluster
40+
41+
```bash
42+
clusterctl generate cluster test-multiple-vlans \
43+
--infrastructure proxmox \
44+
--kubernetes-version v1.28.3 \
45+
--control-plane-machine-count=1 \
46+
--worker-machine-count=2 \
47+
--flavor=multiple-vlans > cluster.yaml
48+
```
49+
50+
## Dual Stack
51+
52+
Regarding dual-stack support, you can use the following environment variables to define the IPv6 ranges for the VMs:
53+
54+
```bash
55+
# The IPv6 ranges for Cluster nodes
56+
export NODE_IPV6_RANGES="[2001:db8:1::1-2001:db8:1::10]"
57+
# The Subnet Mask in CIDR notation for your node IPv6 ranges
58+
export IPV6_PREFIX=64
59+
# The ipv6 gateway for the machines network-config.
60+
export IPV6_GATEWAY="2001:db8:1::1"
61+
```
62+
63+
#### Generate a Cluster
64+
65+
```bash
66+
clusterctl generate cluster test-duacl-stack \
67+
--infrastructure proxmox \
68+
--kubernetes-version v1.28.3 \
69+
--control-plane-machine-count=1 \
70+
--worker-machine-count=2 \
71+
--flavor=dual-stack > cluster.yaml
72+
```
73+
74+
75+
## Notes
76+
77+
* Clusters with IPV6 IPs only is supported.
78+
* Multiple NICs & Dual-stack setups can be mixed together.
79+
* If you're looking for more customized setups, you can create your own cluster template and use it with `clusterctl generate cluster` command.
80+
81+
## API Reference
82+
83+
Please refer to the API reference:
84+
* [CAPMOX API Reference](https://doc.crds.dev/github.com/ionos-cloud/cluster-api-provider-proxmox).

templates/cluster-template-xl-nodes.yaml

Lines changed: 0 additions & 200 deletions
This file was deleted.

templates/cluster-template.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,17 @@ spec:
123123
templateID: ${TEMPLATE_VMID}
124124
format: "qcow2"
125125
full: true
126+
numSockets: ${NUM_SOCKETS:=2}
127+
numCores: ${NUM_CORES:=4}
128+
memoryMiB: ${MEMORY_MIB:=16384}
129+
disks:
130+
bootVolume:
131+
disk: ${BOOT_VOLUME_DEVICE}
132+
sizeGb: ${BOOT_VOLUME_SIZE:=100}
133+
network:
134+
default:
135+
bridge: ${BRIDGE}
136+
model: virtio
126137
---
127138
apiVersion: cluster.x-k8s.io/v1beta1
128139
kind: MachineDeployment
@@ -161,6 +172,17 @@ spec:
161172
templateID: ${TEMPLATE_VMID}
162173
format: "qcow2"
163174
full: true
175+
numSockets: ${NUM_SOCKETS:=2}
176+
numCores: ${NUM_CORES:=4}
177+
memoryMiB: ${MEMORY_MIB:=16384}
178+
disks:
179+
bootVolume:
180+
disk: ${BOOT_VOLUME_DEVICE}
181+
sizeGb: ${BOOT_VOLUME_SIZE:=100}
182+
network:
183+
default:
184+
bridge: ${BRIDGE}
185+
model: virtio
164186
---
165187
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
166188
kind: KubeadmConfigTemplate

0 commit comments

Comments
 (0)