Skip to content

Commit 3e7b1e2

Browse files
committed
Add support for kubeadmConfigTemplate default value
1 parent 6360c79 commit 3e7b1e2

File tree

5 files changed

+29
-8
lines changed

5 files changed

+29
-8
lines changed

charts/capi-proxmox/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords:
88
- bootstrapping
99
- kubernetes
1010
- proxmox
11-
version: 1.0.0
11+
version: 1.0.1
1212
appVersion: v1beta1
1313
home: https://github.com/ionos-cloud/cluster-api-provider-proxmox
1414
sources:

charts/capi-proxmox/templates/_helpers.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,7 @@ range iteration
9999
{{- printf "%s-%s" (include "capi-proxmox.name" .Context) $templateName |
100100
trunc 63 | trimSuffix "-" -}}
101101
{{- end -}}
102+
103+
{{- define "capi-proxmox.kubeadmConfigTemplateJoinConfig" -}}
104+
{{- merge .Context.Values.kubeadmConfigTemplateDefaults .KubeadmConfigTemplate | toYaml }}
105+
{{- end -}}

charts/capi-proxmox/templates/kubeadm-config-template.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ spec:
1414
users:
1515
{{- toYaml . | nindent 8 }}
1616
{{- end }}
17-
{{- with (required (printf
18-
".Values.kubeadmConfigTemplates[%d].joinConfiguration" $index )
19-
$template.joinConfiguration) }}
17+
{{- with
18+
(include "capi-proxmox.kubeadmConfigTemplateJoinConfig" $object |
19+
fromYaml) }}
2020
joinConfiguration:
2121
{{- toYaml . | nindent 8 }}
2222
{{- end }}

charts/capi-proxmox/values-test.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ kubeadmControlPlane:
2626
- name: juan
2727
sshAuthorizedKeys:
2828
- juan
29+
initConfiguration:
30+
nodeRegistration:
31+
taints: []
32+
joinConfiguration:
33+
nodeRegistration:
34+
taints: []
2935

3036
machineTemplates:
3137
- name: control-plane
@@ -62,5 +68,7 @@ kubeadmConfigTemplates:
6268
- name: worker
6369
joinConfiguration:
6470
nodeRegistration:
65-
kubeletExtraArgs:
66-
provider-id: "proxmox://'{{ ds.meta_data.instance_id }}'"
71+
taints:
72+
- key: role
73+
value: storage
74+
effect: NoSchedule

charts/capi-proxmox/values.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,24 @@ kubeadmControlPlane:
199199
preKubeadmCommands:
200200
- /etc/kube-vip-prepare.sh
201201

202+
# This value will be merged with each kubeadmConfigTemplate
203+
kubeadmConfigTemplateDefaults:
204+
joinConfiguration:
205+
nodeRegistration:
206+
kubeletExtraArgs:
207+
provider-id: "proxmox://'{{ ds.meta_data.instance_id }}'"
208+
202209
# KubeadmConfigTemplates to create machines.
203210
# kubectl explain KubeadmConfigTemplate.spec.kubeadmConfigSpec
204211
#
205212
kubeadmConfigTemplates: []
206213
# - name: worker
207214
# joinConfiguration:
208215
# nodeRegistration:
209-
# kubeletExtraArgs:
210-
# provider-id: "proxmox://'{{ ds.meta_data.instance_id }}'"
216+
# taints:
217+
# - key: role
218+
# value: storage
219+
# effect: NoSchedule
211220
# users: []
212221

213222

0 commit comments

Comments
 (0)