Skip to content

Commit 300c4a0

Browse files
Plum through extraVars to the helm chart:
This allows adding arbitrary --set values to the helm chart install. Also, update the chart name and namespace to be Tinkerbell. Signed-off-by: Jacob Weinstock <[email protected]>
1 parent 28e79fc commit 300c4a0

File tree

3 files changed

+38
-21
lines changed

3 files changed

+38
-21
lines changed

capt/config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
clusterName: "capt-playground"
33
outputDir: "output"
4-
namespace: "tink"
4+
namespace: "tinkerbell"
55
counts:
66
controlPlanes: 1
77
workers: 1
88
spares: 1
99
versions:
1010
capt: v0.6.5
11-
chart: v0.18.1
11+
chart: v0.19.0
1212
kube: v1.29.4
1313
os: 20.04
1414
kubevip: 0.9.1
@@ -17,7 +17,11 @@ capt:
1717
#providerRepository: "/home/tink/repos/tinkerbell/cluster-api-provider-tinkerbell/out/release/infrastructure-tinkerbell"
1818
chart:
1919
location: "oci://ghcr.io/tinkerbell/charts/tinkerbell"
20-
#location: "/home/tink/repos/tinkerbell/charts/tinkerbell/stack"
20+
#location: "/home/tink/repos/tinkerbell/tinkerbell/helm/tinkerbell"
21+
extraVars:
22+
#- deployment.image=your.registry.com/tinkerbell/tinkerbell
23+
#- deployment.imageTag=v0.19.1
24+
#- deployment.agentImageTag=latest
2125
os:
2226
registry: ghcr.io/tinkerbell/cluster-api-provider-tinkerbell
2327
distro: ubuntu

capt/scripts/generate_state.sh

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,31 @@
55
cat <<EOF >/dev/null
66
---
77
clusterName: "capt-playground"
8-
outputDir: "/home/tink/repos/tinkerbell/cluster-api-provider-tinkerbell/playground/output"
8+
outputDir: "/home/tink/repos/tinkerbell/playground/capt/output"
99
namespace: "tink"
1010
counts:
1111
controlPlanes: 1
1212
workers: 1
1313
spares: 1
1414
versions:
15-
capt: 0.5.3
16-
chart: 0.5.0
17-
kube: v1.28.8
18-
os: 22.04
15+
capt: v0.6.5
16+
chart: v0.19.0
17+
kube: v1.29.4
18+
os: 20.04
19+
kubevip: 0.9.1
20+
capt:
21+
providerRepository: "https://github.com/tinkerbell/cluster-api-provider-tinkerbell/releases"
22+
chart:
23+
location: "oci://ghcr.io/tinkerbell/charts/tinkerbell"
24+
extraVars:
25+
- deployment.image=custom.registry/tinkerbell/tinkerbell
26+
- deployment.imageTag=v0.19.1
27+
- deployment.agentImageTag=latest
1928
os:
20-
registry: reg.weinstocklabs.com/tinkerbell/cluster-api-provider-tinkerbell
29+
registry: ghcr.io/tinkerbell/cluster-api-provider-tinkerbell
2130
distro: ubuntu
22-
sshKey: ""
23-
version: "2204"
31+
sshKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH9a2GwjgVfnpjOvIqNuJTwazS3tqJ9xzcepXzKMccVf capt-playground"
32+
version: "2004"
2433
vm:
2534
baseName: "node"
2635
cpusPerVM: 2
@@ -51,24 +60,24 @@ vm:
5160
gateway: 172.18.0.1
5261
virtualBMC:
5362
containerName: "virtualbmc"
54-
image: ghcr.io/jacobweinstock/virtualbmc
63+
image: ghcr.io/jacobweinstock/virtualbmc:latest
5564
user: "root"
5665
pass: "calvin"
5766
ip: 172.18.0.3
67+
bootMode: netboot
5868
totalNodes: 3
5969
kind:
60-
kubeconfig: /home/tink/repos/tinkerbell/cluster-api-provider-tinkerbell/playground/output/kind.kubeconfig
70+
kubeconfig: /home/tink/repos/tinkerbell/playground/capt/output/kind.kubeconfig
6171
gatewayIP: 172.18.0.1
6272
nodeIPBase: 172.18.10.20
63-
bridgeName: br-d086780dac6b
73+
bridgeName: br-3d1549d4f99f
6474
tinkerbell:
6575
vip: 172.18.10.74
6676
hookosVip: 172.18.10.73
6777
cluster:
6878
controlPlane:
6979
vip: 172.18.10.75
7080
podCIDR: 172.100.0.0/16
71-
bootMode: netboot
7281
EOF
7382

7483
set -euo pipefail
@@ -145,6 +154,8 @@ function main() {
145154
exit 1
146155
fi
147156
yq e -i ".os.sshKey = \"$ssh_key\"" "$state_file"
157+
# populate the config file with the generated SSH key
158+
# so that we don't re-generate it every time
148159
yq e -i ".os.sshKey = \"$ssh_key\"" "$config_file"
149160
fi
150161
}

capt/tasks/Taskfile-create.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,23 @@ tasks:
115115
sh: yq eval '.namespace' {{.STATE_FILE_FQ_PATH}}
116116
LOCATION:
117117
sh: yq eval '.chart.location' {{.STATE_FILE_FQ_PATH}}
118-
CHART_NAME: tink-stack
118+
CHART_NAME: tinkerbell
119119
BOOTMODE:
120120
sh: yq eval '.bootMode' {{.STATE_FILE_FQ_PATH}}
121121
GLOBAL_VARS:
122122
- trustedProxies={"{{.TRUSTED_PROXIES}}"}
123123
- publicIP={{.LB_IP}}
124-
- artifactsFileServer=http://{{.LB_IP2}}:8080
124+
- artifactsFileServer=http://{{.LB_IP2}}:7173
125125
ISO_VARS:
126126
- deployment.envs.smee.dhcpEnabled=false
127-
- hookos.extension=both
128-
- deployment.envs.smee.isoUpstreamURL=http://{{.LB_IP2}}:8080/hook-latest-lts-x86_64-efi-initrd.iso
127+
- optional.hookos.extension=both
128+
- deployment.envs.smee.isoUpstreamURL=http://{{.LB_IP2}}:7173/hook-latest-lts-x86_64-efi-initrd.iso
129+
EXTRA_VARS:
130+
sh: yq eval '.chart.extraVars | .[]' {{.STATE_FILE_FQ_PATH}} | xargs
129131
cmds:
130-
- KUBECONFIG="{{.KUBECONFIG}}" helm install {{.CHART_NAME}} {{.LOCATION}} --version "{{.STACK_CHART_VERSION}}" --create-namespace --namespace {{.NAMESPACE}} --wait {{range .GLOBAL_VARS}}--set "{{.}}" {{end}} {{- if eq .BOOTMODE "isoboot" }} {{- range .ISO_VARS }}--set "{{.}}" {{end}} {{end}}
132+
- KUBECONFIG="{{.KUBECONFIG}}" helm upgrade --install {{.CHART_NAME}} {{.LOCATION}} --version "{{.STACK_CHART_VERSION}}" --create-namespace --namespace {{.NAMESPACE}} --wait {{range .GLOBAL_VARS}}--set "{{.}}" {{end}} {{- if eq .BOOTMODE "isoboot" }} {{- range .ISO_VARS }}--set "{{.}}" {{ end }} {{ end }} {{- if .EXTRA_VARS }} {{- range (splitList " " .EXTRA_VARS ) }}--set "{{.}}" {{ end }} {{ end }}
131133
status:
132-
- KUBECONFIG="{{.KUBECONFIG}}" helm list -n {{.NAMESPACE}} | grep -q {{.CHART_NAME}}
134+
- helm_status=$(KUBECONFIG="{{.KUBECONFIG}}" helm status -n {{.NAMESPACE}} {{.CHART_NAME}} -o yaml | yq .info.status); [[ "$helm_status" == "deployed" ]]
133135

134136
vms:
135137
run: once

0 commit comments

Comments
 (0)