Skip to content

Commit 0fa4af3

Browse files
authored
Merge branch 'main' into proxmox-go
2 parents 02394ab + 006acd9 commit 0fa4af3

File tree

2 files changed

+70
-27
lines changed

2 files changed

+70
-27
lines changed

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,17 @@ clusterctl init --infrastructure=proxmox:v0.2.2 --config https://raw.githubuserc
2424
2. Create your first workload cluster
2525
```sh
2626
# export env variables
27-
export CONTROLPLANE_HOST=X.X.X.X # for control-plane node
28-
export GATEWAY_ADDRESS=X.X.X.X # for control-plane node
29-
export NAMESERVER_ADDRESS=X.X.X.X # for contro-lplane node
27+
export CONTROLPLANE_HOST=X.X.X.X # control-plane vip
3028
export PROXMOX_URL=https://X.X.X.X:8006/api2/json
31-
# export PROXMOX_PASSWORD=password # (optional)
32-
# export PROXMOX_USER=user@pam # (optional)
33-
export PROXMOX_TOKENID='root@pam!api-token-id'
34-
export PROXMOX_SECRET=aaaaaaaa-bbbb-cccc-dddd-ee12345678
29+
# export PROXMOX_PASSWORD=password # (optional)
30+
# export PROXMOX_USER=user@pam # (optional)
31+
export PROXMOX_TOKENID='root@pam!api-token-id' # (optional)
32+
export PROXMOX_SECRET=aaaaaaaa-bbbb-cccc-dddd-ee12345678 # (optional)
3533
export NODE_URL=node.ssh.url:22
3634
export NODE_USER=node-ssh-user
3735
export NODE_PASSWORD=node-ssh-password
3836

39-
# generate manifests (available flags: --target-namespace, --kubernetes-version, --worker-machine-count)
37+
# generate manifests (available flags: --target-namespace, --kubernetes-version, --controlplane-machine-count, --worker-machine-count)
4038
clusterctl generate cluster cappx-test --worker-machine-count=3 --infrastructure=proxmox:v0.2.2 --config https://raw.githubusercontent.com/sp-yduck/cluster-api-provider-proxmox/main/clusterctl.yaml > cappx-test.yaml
4139

4240
# inspect and edit
@@ -78,7 +76,7 @@ To build your custom node image, you can use [kubernetes-sigs/image-builder](htt
7876

7977
Also there are some available out-of-box images published other communities such as [Metal3](https://github.com/metal3-io). For example https://artifactory.nordix.org/ui/native/metal3/images/. Example MD can be found [metal3-ubuntu2204-k8s127.yaml](examples/machine_deployment/metal3-ubuntu2204-k8s127.yaml).
8078

81-
If it isn't possible to pre-install those prerequisites in the image, you can always deploy and execute some custom scripts through the `ProxmoxMachine.spec.cloudInit` or `KubeadmConfig.spec.preKubeadmCommands` etc. . Example MD can be found [ubuntu2204.yaml](examples/machine_deployment/ubuntu2204.yaml).
79+
If it isn't possible to pre-install those prerequisites in the image, you can always deploy and execute some custom scripts through the `ProxmoxMachine.spec.cloudInit` or `KubeadmConfig` . Example MD can be found [ubuntu2204.yaml](examples/machine_deployment/ubuntu2204.yaml).
8280

8381
## Compatibility
8482

templates/cluster-template.yaml

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,74 @@ spec:
6161
controllerManager:
6262
extraArgs:
6363
cloud-provider: external
64-
etcd:
65-
local:
66-
dataDir: /var/lib/etcd
6764
networking:
6865
dnsDomain: cluster.local
69-
serviceSubnet: 10.96.0.0/12
66+
serviceSubnet: 10.96.0.0/16
7067
podSubnet: 10.244.0.0/16
7168
initConfiguration:
72-
localAPIEndpoint:
73-
advertiseAddress: "${CONTROLPLANE_HOST}"
74-
bindPort: 6443
7569
nodeRegistration:
76-
criSocket: unix:///var/run/containerd/containerd.sock
7770
kubeletExtraArgs:
7871
cloud-provider: external
72+
joinConfiguration:
73+
nodeRegistration:
74+
kubeletExtraArgs:
75+
cloud-provider: external
76+
files:
77+
- content: |
78+
apiVersion: v1
79+
kind: Pod
80+
metadata:
81+
creationTimestamp: null
82+
name: kube-vip
83+
namespace: kube-system
84+
spec:
85+
containers:
86+
- args:
87+
- manager
88+
env:
89+
- name: cp_enable
90+
value: "true"
91+
- name: vip_interface
92+
value: ${VIP_NETWORK_INTERFACE=""}
93+
- name: address
94+
value: ${CONTROLPLANE_HOST}
95+
- name: port
96+
value: "6443"
97+
- name: vip_arp
98+
value: "true"
99+
- name: vip_leaderelection
100+
value: "true"
101+
- name: vip_leaseduration
102+
value: "15"
103+
- name: vip_renewdeadline
104+
value: "10"
105+
- name: vip_retryperiod
106+
value: "2"
107+
image: ghcr.io/kube-vip/kube-vip:v0.5.11
108+
imagePullPolicy: IfNotPresent
109+
name: kube-vip
110+
resources: {}
111+
securityContext:
112+
capabilities:
113+
add:
114+
- NET_ADMIN
115+
- NET_RAW
116+
volumeMounts:
117+
- mountPath: /etc/kubernetes/admin.conf
118+
name: kubeconfig
119+
hostAliases:
120+
- hostnames:
121+
- kubernetes
122+
ip: 127.0.0.1
123+
hostNetwork: true
124+
volumes:
125+
- hostPath:
126+
path: /etc/kubernetes/admin.conf
127+
type: FileOrCreate
128+
name: kubeconfig
129+
status: {}
130+
owner: root:root
131+
path: /etc/kubernetes/manifests/kube-vip.yaml
79132
postKubeadmCommands:
80133
- "curl -L https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl"
81134
- "chmod +x /usr/local/bin/kubectl"
@@ -86,7 +139,7 @@ spec:
86139
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
87140
kind: ProxmoxMachineTemplate
88141
name: ${CLUSTER_NAME}-controlplane
89-
replicas: 1
142+
replicas: ${CONTROL_PLANE_MACHINE_COUNT:=3}
90143
version: ${KUBERNETES_VERSION:=v1.27.3}
91144

92145
---
@@ -108,11 +161,6 @@ spec:
108161
hardware:
109162
cpu: 4
110163
memory: 8192
111-
network:
112-
ipConfig:
113-
gateway: ${GATEWAY_ADDRESS}
114-
ip: "${CONTROLPLANE_HOST}/32"
115-
nameServer: ${NAMESERVER_ADDRESS}
116164
cloudInit:
117165
user:
118166
packages:
@@ -201,10 +249,6 @@ spec:
201249
nodeRegistration:
202250
kubeletExtraArgs:
203251
cloud-provider: external
204-
postKubeadmCommands:
205-
- "curl -L https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl"
206-
- "chmod +x /usr/local/bin/kubectl"
207-
- "reboot now"
208252

209253
---
210254

@@ -301,6 +345,7 @@ spec:
301345
resources:
302346
- kind: ConfigMap
303347
name: cloud-controller-manager
348+
strategy: Reconcile
304349

305350
---
306351

0 commit comments

Comments
 (0)