You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e052727
Browse filesBrowse the repository at this point in the historyBrowse files
Operators wanting to extend the Talos machine config rendered by the
cozystack or generic presets had to fork the chart or hand-edit the
generated per-node YAML against the autogen banner asking them to
keep template edits in values. Add four "extra*" values keys that
plug into the load-bearing sections of machine.* — kernel modules,
sysctls, kubelet.extraConfig, machine.files — without overriding the
preset's hardcoded defaults.
Cozystack preset (append / merge to existing built-ins):
extraKernelModules [] append to openvswitch / drbd / zfs / spl
/ vfio_pci / vfio_iommu_type1
extraKubeletExtraArgs {} merge into cpuManagerPolicy + maxPods;
last-key-wins on conflict (escape hatch)
extraSysctls {} merge into gc_thresh* + nr_hugepages
extraMachineFiles [] append to CRI customization + lvm.conf
Generic preset (emit only when set):
extraKernelModules [] emits machine.kernel.modules block
extraKubeletExtraArgs {} emits kubelet.extraConfig block
extraSysctls {} emits machine.sysctls block
extraMachineFiles [] emits machine.files block
Contract tests under pkg/engine pin append vs merge semantics for
every key on cozystack, on / off state on generic, and the default
generic render still emits no machine.kernel / sysctls / files /
extraConfig blocks (the existing NoCozystackOpinionsOnGeneric guard
stays green). Manual-test-plan B7 / B8 cover both presets with
forward-looking yq queries against the rendered output.
Signed-off-by: Aleksei Sviridkin <[email protected]>
{{- fail (printf"values.yaml: extraKubeletExtraArgs.%s collides with the cozystack preset's built-in kubelet.extraConfig — keys never override (yaml.v3 rejects duplicate map keys on decode). Remove the entry from extraKubeletExtraArgs, or fork the chart preset if you need a different default."$k) }}
52
+
{{- end }}
53
+
{{- end }}
42
54
extraConfig:
43
55
cpuManagerPolicy: static
44
56
maxPods: 512
57
+
{{- with.Values.extraKubeletExtraArgs }}
58
+
{{- toYaml .| nindent 6 }}
59
+
{{- end }}
60
+
{{- /* extraSysctls MUST NOT collide with the preset's built-in
61
+
sysctls; same rationale as extraKubeletExtraArgs. */ -}}
{{- fail (printf"values.yaml: extraSysctls.%s collides with the cozystack preset's built-in machine.sysctls — keys never override (yaml.v3 rejects duplicate map keys on decode). Remove the entry from extraSysctls, or fork the chart preset if you need a different default."$k) }}
Copy file name to clipboardExpand all lines: docs/manual-test-plan.md
+70Lines changed: 70 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -246,6 +246,76 @@ Expected: both renders print "OK" — no `address: 169.254.…` lines anywhere i
246
246
247
247
Regression anchor: a regression that re-introduces the v1.11-only `host`-scope filter would let link-local addresses leak into the legacy `machine.network.interfaces[].addresses` block on a future COSI schema bump that emitted them on the default-gateway-bearing link. Pinned by `TestContract_NetworkLegacy_DefaultAddressesFilterLinkScope` with a `linkScopedAddressOnDefaultGatewayLookup` fixture, but the live render is still useful as a sanity check against real cluster discovery output.
248
248
249
+
### B7. `extra*` operator extension points (cozystack: append to defaults)
250
+
251
+
The cozystack preset ships hardcoded defaults for kernel modules, sysctls, kubelet extraConfig, and machine.files. The matching `extra*` values keys let an operator extend each block without forking the chart. Set every key, re-render, and inspect each affected section:
-`.machine.kernel.modules` lists the built-in six (`openvswitch`, `drbd` with `usermode_helper=disabled`, `zfs`, `spl`, `vfio_pci`, `vfio_iommu_type1`) AND `nf_conntrack` — append, never override.
279
+
-`.machine.kubelet.extraConfig` carries the built-ins (`cpuManagerPolicy: static`, `maxPods: 512`) AND `feature-gates: NodeSwap=true`. Operator keys MUST NOT collide with built-ins; a collision fails the render at template time.
280
+
-`.machine.sysctls` carries the built-in `gc_thresh1/2/3` and `vm.nr_hugepages` (when set) AND `net.core.somaxconn`. Same rejection-on-collision rule.
281
+
-`.machine.files[].path` lists `/etc/cri/conf.d/20-customization.part`, `/etc/lvm/lvm.conf`, AND `/etc/example/operator.conf`.
282
+
283
+
Verify the rejection path explicitly. Set an operator key that collides with a built-in (e.g. `extraSysctls: { "net.ipv4.neigh.default.gc_thresh1": "9000" }`) and re-render:
Expected: render fails with `Error: values.yaml: extraSysctls.net.ipv4.neigh.default.gc_thresh1 collides with the cozystack preset's built-in machine.sysctls — keys never override (yaml.v3 rejects duplicate map keys on decode). Remove the entry from extraSysctls, or fork the chart preset if you need a different default.` Same shape for `extraKubeletExtraArgs.maxPods` etc. The "fork the preset" escape hatch is the only supported path to change a built-in default.
290
+
291
+
Regression anchor: contract tests `TestContract_Machine_Extra{KernelModules,KubeletExtraArgs,Sysctls,MachineFiles}_Cozystack_*` pin append / merge semantics for each section. The `_RejectsCollisionWithBuiltin` tests pin the failure mode for every built-in key. A regression that swaps the chart-level `fail` for a silent `toYaml | nindent` would render duplicate map keys; the matching `_MergeInto*` test round-trip-decodes through yaml.v3 (which refuses duplicates), and the `_RejectsCollisionWithBuiltin` cases would also fail.
The generic preset ships no defaults for the same four blocks. Each `machine.*` block appears in the render ONLY when its `extra*` values key is non-empty.
if [ "$(yq ".machine.$k" /tmp/render.yaml)"="null" ];then
303
+
echo"OK: no $k block"
304
+
else
305
+
echo"FAIL: $k block leaked into default generic render"
306
+
fi
307
+
done
308
+
if [ "$(yq '.machine.kubelet.extraConfig' /tmp/render.yaml)"="null" ];then
309
+
echo"OK: no extraConfig"
310
+
else
311
+
echo"FAIL: extraConfig leaked"
312
+
fi
313
+
```
314
+
315
+
Expected: all four prints "OK". Set any single `extra*` key non-empty, re-render — only the matching block appears; the other three stay absent. The `yq ... = "null"` form is exact-match: `yq` emits the literal string `null` on a single line for an absent path, so a leaking empty block (`modules: []`, `extraConfig: {}`) shows up as a non-`null` value and trips the FAIL branch.
316
+
317
+
Regression anchor: contract tests `TestContract_Machine_Extra*_Generic_NonEmptyEmitsBlock` pin the on-state for each block; `TestContract_Machine_NoCozystackOpinionsOnGeneric` pins the off-state at default values. A regression that emits an empty `modules: []` / `sysctls: {}` / `files: []` block in the default render would fail the latter.
318
+
249
319
## C. Apply (auth path)
250
320
251
321
This section is the smoke-test for the apply pipe itself; the per-gate matrix lives in **Section C-safety** below.
0 commit comments