Skip to content

Commit 0bc3f9f

Browse files
authored
fix(kubernetes): name TalosConfigTemplate by content hash (#3523)
## What this PR does Fixes #3515. `TalosConfigTemplate.spec` is immutable — the `vtalosconfigtemplate.cluster.x-k8s.io` webhook denies any mutation with `TalosConfigTemplate.Spec is immutable` — but the `talos-reconcile` Job applied it under a fixed `<release>-<group>` name on every reconcile. Once the template existed, **no change to the rendered worker machine config could ever reach the cluster**: the apply was rejected server-side while the HelmRelease stayed `Ready`. Reported with `machine.network.searchDomains` after a `clusterDomain` correction; the same held for `certSANs`, `machine.registries` and nameservers. - Name the `TalosConfigTemplate` `<release>-<group>-<6-char hash of its spec>`, mirroring the `KubevirtMachineTemplate` content-hash idiom the chart already uses, and point `MachineDeployment.spec.template.spec.bootstrap.configRef` at that name. A content change now creates a **new** template instead of attempting a rejected mutation, and CAPI rolls the workers onto it. - Extract the machine config into a single named template (`_talosconfigtemplate.tpl`) shared by the two consumers that have to agree on the name byte-for-byte: the Job, which embeds it in the heredoc it `kubectl apply`s, and the `MachineDeployment`, which hashes it into `configRef`. - Assemble the node group once, in `kubernetes-nodes.group`, and read it back at both call sites. Sharing the rendering was not enough: each file also built its own `$group` dict, so the two names agreed only by coincidence of the keys the spec helper happens to read. - The runtime values the Job substitutes (`${TALOS_CA_B64}`, `${SVC_IP}`, `${COREDNS_IP}`, tokens) stay shell placeholders and are deliberately **not** part of the hash: they are facts of an already-provisioned cluster, not chart inputs, so a certificate rotation or a Service re-address does not roll workers. ### What the shared spec carries Worker node pools live in the `kubernetes-nodes` chart, which owns `_talosconfigtemplate.tpl` outright: `make update` copies nothing from the parent chart. The helper renders everything `main` puts into the worker machine config, so the hashed spec is the one the cluster gets: - The heredoc escaping from #3513: backslash, dollar and backtick escaping on `talosVersion`, `installerRepository` and `schematicID`, the escaped `machine.registries.mirrors` block, and the `INVARIANT` comment above `data:`, which belongs in that file since it is where the next field will be added. The spec is still emitted from an unquoted heredoc in a host-cluster Pod, so an unescaped copy would be command injection. - The per-pool install image. `_talosconfigtemplate.tpl` calls `kubernetes-nodes.resolveOsImage` itself instead of reading `talos.schematicID` and `talos.version`, so a pool on `osImage.builtin` or `osImage.factory` reinstalls the schematic and version it actually booted. The install image is part of the hashed spec, so the hash has to be taken over the resolved image, or an `osImage` change would render a different config under an unchanged name. - The Proxmox branches: `nameservers` from `proxmox.dnsServers` where a KubeVirt pool points at the cluster's CoreDNS, and the kubelet's `cloud-provider: external`, without which the Proxmox cloud-controller-manager never initialises the Node. - `machine.kernel.modules`, emitted only when the pool resolves to a non-empty list. `kubernetes-nodes.group` carries every key those read, `podCpuLimit`, `podCpuRequest`, `osImage`, `proxmox` and `kernelModules` included. A key missing there is the failure this PR exists to prevent: with `kernelModules` read at one call site only, an explicit module list hashes to two different names and the `MachineDeployment` points at a template nothing creates. The `kubectl apply` stays `--server-side --force-conflicts` (#4163), so the Job is not OOMKilled on the merge path; with a content-hash name the apply is normally a create or a no-op, and server-side apply keeps the no-op cheap too. ### The replace-on-immutable path and the Role The runtime values stay outside the hash, so one failure is left that the hash cannot absorb: a new apiserver address renders a different spec under an unchanged name, and the webhook rejects it. The replace path from #4089 handles exactly that case and is kept, with its `kubectl delete` pointed at `${TCT_NAME}`. The talos-reconcile Role pins its TalosConfigTemplate `get`, `patch`, `update` and `delete` rights to the pool's own template, so it names the hashed template too. A server-side apply of a template that does not exist yet is still a PATCH on its name: a rule left on `<release>-<group>` would leave the Job Forbidden and the pool with no template to scale onto, with nothing turning red. The name-agreement guard below therefore covers the Role as well. ## Upgrade impact — please read **Existing clusters roll their Talos workers once.** The `configRef` moves from `<release>-<group>` to the hashed name; CAPI creates a new `MachineSet` for it and rolls machines onto it under the existing `RollingUpdate` strategy (`maxSurge: maxReplicas`, `maxUnavailable: 1`) plus the group's `MachineHealthCheck`. The rendered machine config itself is byte-identical to `main` for the same values, so this particular roll delivers no config change — it is the one-time cost of adopting the content-hash name, the same cost `KubevirtMachineTemplate` already paid. Proxmox pools roll the same way: the `ProxmoxMachineTemplate` name does not move, but the `configRef` does. **Until the new template exists, the pool cannot scale.** The Helm upgrade points the `MachineDeployment`'s `configRef` at the hashed name before the `talos-reconcile` Job has created that template, and there is no render-time ordering fix, since the template needs values Helm does not have. Existing workers are untouched in that window, but the pool is frozen: in CAPI v1.10.1, which this repository ships, `getTemplatesAndSetOwner` records the missing bootstrap template, and `rolloutRolling` then fails in `getAllMachineSetsAndSyncRevision` with `cannot create a new MachineSet when templates do not exist` and returns before it scales either the new or the old `MachineSet`. A replica change from the cluster-autoscaler therefore reaches no `MachineSet`: scale-up and scale-down both wait. On an upgraded cluster the Job's inputs already exist, so the window is normally a few seconds. **A failed `talos-reconcile` Job now blocks autoscaling, and nothing turns red.** After `backoffLimit: 30` the Job is not retried until the next Helm upgrade of the pool release, and the HelmRelease stays `Ready` meanwhile, as it did in #3515. Before this PR the same failure left the pool on its old template and still scaling; with it, the pool cannot scale at all until the template exists. Where to look: - the `MachineDeployment` `kubernetes-<cluster>-<group>`: its `ScalingUp` condition under `status.v1beta2.conditions` reads `Scaling up from N to M replicas is blocked because TalosConfigTemplate does not exist` (or `Scaling up would be blocked because …` while no scale-up is pending), and the capi-controller-manager logs carry `cannot create a new MachineSet when templates do not exist` for it; - whether a `TalosConfigTemplate` named after its `spec.template.spec.bootstrap.configRef.name` exists in the tenant namespace; - the `talos-reconcile` Job's status and Pod logs — but the Job has `ttlSecondsAfterFinished: 600`, so a failed Job and its logs are deleted ten minutes after it gives up. Past that, the `MachineDeployment` condition and the missing template are the only evidence left. The pre-existing fixed-name template is **not** deleted — the outgoing `MachineSet` still references it — and is garbage-collected with the `KamajiControlPlane` when the cluster is deleted. Hashed templates therefore accumulate, one per distinct machine config. Pruning them safely is filed as #4355 rather than widened into this PR. **The one roll is not the only one.** Hashing the whole rendered spec makes anything inside it a roll trigger, including two things that are not edits to this cluster's resource. For a pool sized by `instanceType`, the kubelet reservations come from a live `lookup` of the `VirtualMachineClusterInstancetype`, so a later platform-side edit to that instancetype rotates the name and rolls the pool again — and the `KubevirtMachineTemplate` hash this mirrors does not have that property, since it embeds the instancetype by name and never its resolved size. And `talos.registryMirrors` is inside the hashed spec, so setting or changing a mirror now rolls the pool rather than applying only to nodes created later; the field's documentation said nothing about this and now says it. The same holds on Proxmox for `proxmox.dnsServers`, and on every substrate for `kernelModules`: both are inside the hashed spec, so changing either rolls the pool, and the `kernelModules` documentation now says so instead of describing the fixed name as the current state. **The roll is not free on a node group holding a scarce resource.** From exercising this same rollout path on a production fleet of 13 tenant clusters, by rotating the `KubevirtMachineTemplate` hash on a GPU node group. `maxSurge: maxReplicas` is dangerous when the resource is constrained: with 6 GPUs and 1 free, CAPI created all 5 new machines at once and 3 sat `Pending` on `Insufficient nvidia.com/...`, each having already imported a 200 GiB disk. It converges, but it wastes a lot of import. The natural reflex, `maxSurge: 0` with `maxUnavailable: 1`, deadlocks instead: CAPI computes `maxScaledDown = available - (desired - maxUnavailable)`, which was `4 - 4 = 0`, so it removed no old machine while the new ones waited for exactly those machines to release their GPUs; nothing moved until `maxUnavailable` was loosened to 2. And the `MachineHealthCheck` amplifies both — at `maxUnhealthy: 100%` and `nodeStartupTimeout: 10m`, machines queuing for a GPU were declared unhealthy and remediated in a loop, three deleted and recreated while perfectly healthy, each iteration re-importing the disk. The per-node-group `nodeStartupTimeout` override fixes that, but the default is shorter than a plausible queue wait. Anyone upgrading a fleet with a GPU pool hits all three, and this PR is what starts the roll. ## Validation - `helm unittest packages/apps/kubernetes-nodes` passes, snapshots included. Pointing `configRef` back at the fixed name fails `nodegroup_test.yaml`, the snapshot and the name-agreement bats; dropping `osImage` from `kubernetes-nodes.group` fails the `worker_image_*` suites; removing the Proxmox nameserver branch fails `substrate_branches_test.yaml` and the Proxmox heredoc case. - `hack/check-talosconfigtemplate-name-agreement.bats` is new. The unittest suites pin each name against its own literal in its own file, so a divergence shows up as one literal having moved, which reads as a stale fixture and invites re-pasting the value. The guard renders the chart once and compares the Job's `TCT_NAME`, the Role's TalosConfigTemplate `resourceNames` and the `MachineDeployment`'s `configRef.name` against each other, so the failure states the invariant rather than a number. Asserted on a GPU-shaped pool as well as the default one, because the default renders `gpus []`, `kubelet {}` and `instanceType ""` as falsy and a consumer reading a subset of the group is indistinguishable there from one reading all of it; on an explicit `kernelModules` list, which neither of those shapes sets; and a last case pins that the shapes hash differently, so the others cannot hold vacuously. Verified by injecting each divergence: dropping `gpus` at one call site, dropping `kernelModules` at one call site, and pointing the Role back at `<release>-<group>` each fail it, the last one also failing the Role cases in `talos_tct_immutable_test.yaml`, as does pointing the `delete` back at the fixed name. - `hack/cozytest.sh hack/talos-reconcile-heredoc_test.bats` passes, the Proxmox cases included. This is the execution-level evidence that the escaping survived the move into `_talosconfigtemplate.tpl`: it renders with a hostile `registryMirrors` endpoint and a hostile `installerRepository`, runs the extracted heredoc through a real shell, and asserts the values come out literal rather than command-substituted; hostile `schematicID` and `version` values, and `proxmox.dnsServers` entries that are not addresses, are asserted refused at render; and the Proxmox heredoc is asserted to emit the nameservers it was given. A rendered-string regex cannot catch a heredoc the shell refuses to emit; this does. - `make generate` in `packages/apps/kubernetes-nodes` — no diff. - The "byte-identical to `main`" claim was measured against `main` on six pool shapes: default, GPU, an explicit `kernelModules` list, `kernelModules: []` on a GPU pool, `osImage.factory` and Proxmox. For each, the `TalosConfigTemplate` manifest the Job applies differs only in its name (`${RELEASE}-${GROUP_NAME}` → `${TCT_NAME}`); the spec is unchanged, the Job's `TCT_NAME` equals the `MachineDeployment`'s `configRef.name`, and the `KubevirtMachineTemplate` and `ProxmoxMachineTemplate` names do not move. - **Not verified:** no live-cluster or e2e run (needs bare-metal nodes). The upgrade sequence above, the scaling freeze included, comes from reading the CAPI v1.10.1 `MachineDeployment` controller source and the chart's existing `KubevirtMachineTemplate` precedent, not from watching it end to end. ### Downstream repositories - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: Every box is left empty on purpose, including the first, because I am not confident about one line of the map and would rather a maintainer decided than have me tick it. The change adds no field and changes no default: the only schema movement is the description text of `talos.registryMirrors` and `kernelModules`, regenerated from their `values.yaml` doc comments. Nothing else downstream restates this chart's templates, the hash naming is internal to the chart, and no image reference, CI behaviour or CRD shape moves. The open question is whether `terraform-provider-cozystack` restates field descriptions as well as field shapes; if it does, those description changes reach it and want a follow-up. ## Release note ```release-note fix(kubernetes): name the worker TalosConfigTemplate after a hash of its content so machine-config changes (searchDomains, certSANs, registries, nameservers) actually propagate instead of being silently rejected by the immutability webhook. Upgrading rolls existing Talos workers once, on KubeVirt and Proxmox pools alike. Until the talos-reconcile Job has created the new template, the pool cannot scale, so a failed talos-reconcile Job now blocks cluster-autoscaler scale-up and scale-down while the HelmRelease stays Ready; check the MachineDeployment's ScalingUp condition ("blocked because TalosConfigTemplate does not exist") and the Job status, which is deleted ten minutes after it fails. On a node group holding a scarce resource such as GPUs, review the MachineDeployment surge settings and the MachineHealthCheck nodeStartupTimeout first: `maxSurge: 0` can deadlock the roll and the default startup timeout can trigger spurious remediation while machines queue for the resource. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Worker Talos configuration templates now use content-hashed names for consistent reconciliation and bootstrap references. * Changes to worker machine configuration, including GPU and registry mirror settings, automatically roll existing workers. * **Documentation** * Updated registry mirror documentation to explain that configuration changes roll all workers in the pool. * **Tests** * Added coverage for hashed template names, configuration-triggered worker rotations, and matching references across worker resources. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 4f043b5 + 9afe7f1 commit 0bc3f9f

15 files changed

Lines changed: 752 additions & 337 deletions

File tree

‎api/apps/v1alpha1/kubernetesnodes/types.go‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
#!/usr/bin/env bats
2+
# -----------------------------------------------------------------------------
3+
# The TalosConfigTemplate is named after a content hash of the worker machine
4+
# config, and three places in kubernetes-nodes have to arrive at that name:
5+
#
6+
# * talos-reconcile-job.yaml creates the object, passing the name to the Job
7+
# as TCT_NAME;
8+
# * the same file's Role pins the Job's get/patch/update and delete rights on
9+
# TalosConfigTemplates to it by resourceNames;
10+
# * nodegroup.yaml points MachineDeployment.spec.template.spec.bootstrap
11+
# .configRef.name at it.
12+
#
13+
# If the Job and the MachineDeployment disagree, the MachineDeployment
14+
# references a TalosConfigTemplate that is never created. If the Role disagrees,
15+
# the Job's server-side apply -- a PATCH on the name, even for a create -- is
16+
# Forbidden and the template is never created either. CAPI does not fail in
17+
# either case: it blocks on "templates do not exist" and no worker is ever
18+
# built, so the divergence surfaces as a cluster that quietly never scales
19+
# rather than as a render error.
20+
#
21+
# The chart's helm-unittest suites pin both names, but each pins its own
22+
# literal in its own file. That catches a divergence, yet the output only says
23+
# one literal moved -- which reads as a stale fixture, and re-pasting the new
24+
# value is then the obvious and wrong fix. This guard renders the chart ONCE and
25+
# compares the two values against each other, so the failure states the
26+
# invariant instead of a number.
27+
#
28+
# Rendered with explicit resources rather than an instanceType: an
29+
# instanceType-sized pool resolves its kubelet reservations through a live
30+
# `lookup` of the VirtualMachineClusterInstancetype, which is empty outside a
31+
# cluster. The invariant under test does not depend on which sizing source is
32+
# used -- both consumers read the same assembled group either way.
33+
#
34+
# Compatible with both `bats` directly and the in-repo cozytest.sh runner, which
35+
# runs each @test in a fresh subshell under `set -u` and honors no setup() or
36+
# teardown(), so TMP is provisioned inline per test and cleaned without an EXIT
37+
# trap (docs/agents/e2e-testing.md bans those here).
38+
39+
REPO_ROOT="$(cd "$(dirname "${BATS_TEST_FILENAME:-$0}")/.." && pwd)"
40+
CHART="$REPO_ROOT/packages/apps/kubernetes-nodes"
41+
42+
render_pool() {
43+
# $1: output file, remaining args: extra --set flags for the pool shape
44+
out="$1"; shift
45+
helm template kubernetes-nodes-myk8s-md0 "$CHART" \
46+
--namespace tenant-test \
47+
--set cluster=myk8s \
48+
--set _cluster.cluster-domain=cozy.local \
49+
--set version=v1.35 \
50+
--set minReplicas=0 --set maxReplicas=3 \
51+
--set instanceType="" \
52+
--set diskSize=20Gi --set storageClass=replicated \
53+
--set 'roles[0]=ingress-nginx' \
54+
--set resources.cpu=2 --set resources.memory=4Gi \
55+
"$@" > "$out" 2>"$out.err"
56+
[ -s "$out" ] || { cat "$out.err" >&2; return 1; }
57+
}
58+
59+
job_tct_name() {
60+
awk '/name: TCT_NAME/ { getline; sub(/^[[:space:]]*value:[[:space:]]*/, ""); gsub(/"/, ""); print; exit }' "$1"
61+
}
62+
63+
role_tct_names() {
64+
# One line per Role rule on talosconfigtemplates that carries resourceNames.
65+
awk '/resources: \["talosconfigtemplates"\]/ { getline; if ($0 ~ /resourceNames:/) { sub(/.*resourceNames:[[:space:]]*\[/, ""); sub(/\].*/, ""); gsub(/"/, ""); print } }' "$1"
66+
}
67+
68+
md_config_ref_name() {
69+
awk '/configRef:/ { f=1; next } f && /name:/ { sub(/^[[:space:]]*name:[[:space:]]*/, ""); print; exit }' "$1"
70+
}
71+
72+
assert_agreement() {
73+
tmp="$1"; shape="$2"
74+
job=$(job_tct_name "$tmp/r.yaml")
75+
md=$(md_config_ref_name "$tmp/r.yaml")
76+
77+
# An empty capture means the render stopped emitting one of the two fields,
78+
# which would make a naive string comparison pass on "" == "".
79+
if [ -z "$job" ] || [ -z "$md" ]; then
80+
echo "FAIL: could not read both names out of the $shape render."
81+
echo " Job TCT_NAME: '${job:-<missing>}'"
82+
echo " MachineDeployment ref: '${md:-<missing>}'"
83+
echo "Either the field moved or the render is incomplete; this guard cannot"
84+
echo "compare what it cannot find, so it fails rather than pass vacuously."
85+
return 1
86+
fi
87+
88+
if [ "$job" != "$md" ]; then
89+
echo "FAIL: the two TalosConfigTemplate names must be equal, and are not ($shape pool)."
90+
echo " talos-reconcile-job.yaml creates: $job"
91+
echo " nodegroup.yaml references: $md"
92+
echo "The MachineDeployment now points at a TalosConfigTemplate nothing creates."
93+
echo "CAPI blocks on \"templates do not exist\" and builds no worker, without"
94+
echo "failing the release. Both names come from a hash of the group assembled"
95+
echo "by kubernetes-nodes.group in templates/_helpers.tpl: they diverge when a"
96+
echo "call site stops feeding that helper, or when a key it carries is dropped."
97+
echo "Fix the input they share; do not re-pin either literal."
98+
return 1
99+
fi
100+
101+
# Two named rules: get/patch/update, and delete. Fewer means one went unnamed
102+
# or disappeared, and the per-rule comparison below would pass on nothing.
103+
roles=$(role_tct_names "$tmp/r.yaml")
104+
if [ "$(printf '%s\n' "$roles" | grep -c .)" -ne 2 ]; then
105+
echo "FAIL: expected two named TalosConfigTemplate rules in the talos-reconcile Role ($shape pool), found:"
106+
printf ' %s\n' "${roles:-<none>}"
107+
return 1
108+
fi
109+
for r in $roles; do
110+
if [ "$r" != "$md" ]; then
111+
echo "FAIL: the talos-reconcile Role names a TalosConfigTemplate the Job does not apply ($shape pool)."
112+
echo " Role resourceNames: $r"
113+
echo " nodegroup.yaml references: $md"
114+
echo "The Job's server-side apply is a PATCH on the template's name even when"
115+
echo "it creates it, so it is Forbidden, and the pool never gets a template"
116+
echo "to scale onto. Name the rule after the same content-hash name."
117+
return 1
118+
fi
119+
done
120+
}
121+
122+
@test "Job and MachineDeployment agree on the TalosConfigTemplate name" {
123+
TMP=$(mktemp -d)
124+
render_pool "$TMP/r.yaml"
125+
assert_agreement "$TMP" "default"
126+
rm -rf "$TMP"
127+
}
128+
129+
@test "they still agree once the hashed spec changes (GPU pool)" {
130+
# A GPU pool renders extra nodeLabels into the machine config, so the hash --
131+
# and therefore both names -- must move together. Pinning the agreement on a
132+
# second shape is what catches a call site that reads a subset of the group:
133+
# the default shape renders gpus [], kubelet {} and instanceType "" as falsy,
134+
# so a consumer missing those keys is indistinguishable from one carrying them.
135+
TMP=$(mktemp -d)
136+
render_pool "$TMP/r.yaml" --set 'gpus[0].name=nvidia.com/GH200'
137+
assert_agreement "$TMP" "GPU"
138+
rm -rf "$TMP"
139+
}
140+
141+
@test "they still agree with an explicit kernelModules list" {
142+
# kernelModules has no values.yaml default, so the default and GPU shapes both
143+
# leave it unset and cannot tell a call site that carries it from one that
144+
# does not. Only a set value moves the hash on one side alone.
145+
TMP=$(mktemp -d)
146+
render_pool "$TMP/r.yaml" --set 'kernelModules[0].name=br_netfilter'
147+
assert_agreement "$TMP" "kernelModules"
148+
rm -rf "$TMP"
149+
}
150+
151+
@test "the two shapes hash differently" {
152+
# Guards the guard: if both renders collapsed to the same name, the agreement
153+
# assertions above would hold trivially and stop proving anything.
154+
TMP=$(mktemp -d)
155+
render_pool "$TMP/plain.yaml"
156+
render_pool "$TMP/gpu.yaml" --set 'gpus[0].name=nvidia.com/GH200'
157+
plain=$(job_tct_name "$TMP/plain.yaml")
158+
gpu=$(job_tct_name "$TMP/gpu.yaml")
159+
if [ "$plain" = "$gpu" ]; then
160+
echo "FAIL: the plain and GPU pools hashed to the same name ($plain)."
161+
echo "The content hash is supposed to track the rendered spec, and a GPU pool"
162+
echo "renders different nodeLabels. Equal names mean the hash input no longer"
163+
echo "covers the field that changed."
164+
false
165+
fi
166+
rm -rf "$TMP"
167+
}

‎packages/apps/kubernetes-nodes/Makefile‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ generate:
1313
# kubectl.tag used by the talos-reconcile Job) in lockstep with the parent
1414
# kubernetes chart. They are copied, not symlinked, so `helm package` bundles
1515
# them; run this after the parent chart's `make update`.
16+
#
17+
# _talosconfigtemplate.tpl is not copied from anywhere: the parent chart no
18+
# longer carries worker node pools, so this chart owns the worker machine
19+
# config outright. It stays here because the TalosConfigTemplate it renders is
20+
# content-hash named and both consumers in this chart - nodegroup.yaml, which
21+
# writes bootstrap.configRef, and talos-reconcile-job.yaml, which creates the
22+
# object - have to hash the same bytes.
1623
update:
1724
cp ../kubernetes/files/versions.yaml files/versions.yaml
1825
cp ../kubernetes/images/kubectl.tag images/kubectl.tag

0 commit comments

Comments
 (0)