Skip to content

Commit c4f62f4

Browse files
committed
fix(cozystack): load drbd_transport_tcp explicitly
Talos v1.14 ships a kernel with an empty modprobe path (siderolabs/pkgs#1565), so /proc/sys/kernel/modprobe is empty and the kernel no longer loads modules on request_module(). DRBD requests its transport module that way when a resource first connects to a peer, so on v1.14 drbdsetup new-peer fails with "Failed to create transport (drbd_transport_xxx module missing?)" and every DRBD resource on the node stays in Connecting. Listing drbd_transport_tcp in machine.kernel.modules makes Talos load it up front; applying that to an affected node restored connectivity without a reboot. The module ships in the drbd extension for both v1.13 and v1.14, so loading it explicitly is safe on either. Signed-off-by: Aleksei Sviridkin <[email protected]> Assisted-by: LLM
1 parent dac1d2c commit c4f62f4

8 files changed

Lines changed: 30 additions & 18 deletions

‎charts/cozystack/templates/_helpers.tpl‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ machine:
124124
- name: drbd
125125
parameters:
126126
- usermode_helper=disabled
127+
- name: drbd_transport_tcp
127128
- name: zfs
128129
- name: spl
129130
- name: vfio_pci

‎charts/cozystack/values.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ etcd:
140140
# need different defaults fork the preset.
141141

142142
# Extra kernel modules to load on every node, appended to the preset's
143-
# built-in list (openvswitch, drbd, zfs, spl, vfio_pci, vfio_iommu_type1).
143+
# built-in list (openvswitch, drbd, drbd_transport_tcp, zfs, spl, vfio_pci,
144+
# vfio_iommu_type1).
144145
# Lists append unconditionally — duplicates by `name` are tolerated by
145146
# Talos at load time. Each entry is a Talos kernel module spec; see
146147
# Talos docs for the full shape. Examples:

‎docs/manual-test-plan.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ yq '.machine.files[].path' /tmp/render.yaml
420420

421421
Expected:
422422

423-
- `.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.
423+
- `.machine.kernel.modules` lists the built-in seven (`openvswitch`, `drbd` with `usermode_helper=disabled`, `drbd_transport_tcp`, `zfs`, `spl`, `vfio_pci`, `vfio_iommu_type1`) AND `nf_conntrack` — append, never override.
424424
- `.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.
425425
- `.machine.sysctls` carries the built-in `gc_thresh1/2/3`, the always-on DRBD tuning (`net.ipv4.tcp_orphan_retries`, `net.ipv4.tcp_fin_timeout`, `net.core.netdev_max_backlog`, `net.core.netdev_budget`, `net.core.netdev_budget_usecs`), `vm.nr_hugepages` (when set), AND `net.core.somaxconn`. Same rejection-on-collision rule (the DRBD keys are preset-owned too). See B9 for the keepalive triplet and etcd quota.
426426
- `.machine.files[].path` lists `/etc/cri/conf.d/20-customization.part`, `/etc/lvm/lvm.conf`, AND `/etc/example/operator.conf`.

‎pkg/engine/contract_machine_test.go‎

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,17 @@ func TestContract_Machine_Sysctls_NrHugepages_PresentWhenSet_Cozystack(t *testin
196196
assertContains(t, out, `vm.nr_hugepages: "1024"`)
197197
}
198198

199-
// Contract: cozystack pins six kernel modules (openvswitch, drbd, zfs,
200-
// spl, vfio_pci, vfio_iommu_type1). Each is required by a specific
201-
// cozystack feature: openvswitch for Cilium netkit-style routing, drbd
202-
// for DRBD storage, zfs+spl for ZFS, vfio_* for PCI passthrough.
199+
// Contract: cozystack pins seven kernel modules (openvswitch, drbd,
200+
// drbd_transport_tcp, zfs, spl, vfio_pci, vfio_iommu_type1). Each is
201+
// required by a specific cozystack feature: openvswitch for Cilium
202+
// netkit-style routing, drbd for DRBD storage, zfs+spl for ZFS, vfio_*
203+
// for PCI passthrough.
203204
// drbd carries `parameters: [usermode_helper=disabled]` — required so
204205
// drbd does not invoke /sbin/drbdadm at every state change (the
205-
// cozystack image does not ship drbdadm). Removing any of these
206+
// cozystack image does not ship drbdadm). drbd_transport_tcp is listed
207+
// explicitly because the Talos v1.14 kernel has an empty modprobe path,
208+
// so DRBD's request_module() for its transport no longer loads it and
209+
// every DRBD resource stays in Connecting. Removing any of these
206210
// modules silently breaks the matching feature.
207211
func TestContract_Machine_KernelModules_Cozystack(t *testing.T) {
208212
for _, cell := range cozystackCells() {
@@ -213,6 +217,7 @@ func TestContract_Machine_KernelModules_Cozystack(t *testing.T) {
213217
assertContains(t, out, "- name: openvswitch")
214218
assertContains(t, out, "- name: drbd")
215219
assertContains(t, out, "- usermode_helper=disabled")
220+
assertContains(t, out, "- name: drbd_transport_tcp")
216221
assertContains(t, out, "- name: zfs")
217222
assertContains(t, out, "- name: spl")
218223
assertContains(t, out, "- name: vfio_pci")
@@ -254,11 +259,11 @@ func TestContract_Machine_KernelModules_Cozystack(t *testing.T) {
254259
// failure mode for every built-in key.
255260

256261
// Contract: values.extraKernelModules APPENDS to the cozystack preset's
257-
// built-in module list — it never overrides. The built-in six
258-
// (openvswitch, drbd, zfs, spl, vfio_pci, vfio_iommu_type1) are
259-
// load-bearing for cozystack's storage/networking stack, so an
260-
// operator who supplies extra modules must NOT silently drop any of
261-
// the built-ins.
262+
// built-in module list — it never overrides. The built-in seven
263+
// (openvswitch, drbd, drbd_transport_tcp, zfs, spl, vfio_pci,
264+
// vfio_iommu_type1) are load-bearing for cozystack's storage/networking
265+
// stack, so an operator who supplies extra modules must NOT silently
266+
// drop any of the built-ins.
262267
func TestContract_Machine_ExtraKernelModules_Cozystack_AppendValues(t *testing.T) {
263268
out := renderCozystackWith(t, helmEngineEmptyLookup, map[string]any{
264269
"advertisedSubnets": []any{testAdvertisedSubnet},
@@ -267,10 +272,11 @@ func TestContract_Machine_ExtraKernelModules_Cozystack_AppendValues(t *testing.T
267272
map[string]any{"name": "br_netfilter"},
268273
},
269274
})
270-
// Built-in six still present.
275+
// Built-in seven still present.
271276
assertContains(t, out, "- name: openvswitch")
272277
assertContains(t, out, "- name: drbd")
273278
assertContains(t, out, "- usermode_helper=disabled")
279+
assertContains(t, out, "- name: drbd_transport_tcp")
274280
assertContains(t, out, "- name: zfs")
275281
assertContains(t, out, "- name: spl")
276282
assertContains(t, out, "- name: vfio_pci")
@@ -281,7 +287,7 @@ func TestContract_Machine_ExtraKernelModules_Cozystack_AppendValues(t *testing.T
281287
}
282288

283289
// Contract: an empty values.extraKernelModules (or its default `[]`)
284-
// leaves the cozystack module list IDENTICAL to the built-in six — no
290+
// leaves the cozystack module list IDENTICAL to the built-in seven — no
285291
// `[]` suffix, no empty-list artifact, no trailing module lines. The
286292
// `{{- with .Values.extraKernelModules }}` guard relies on Helm's
287293
// emptiness check; a regression that swaps `with` for a bare
@@ -295,12 +301,12 @@ func TestContract_Machine_ExtraKernelModules_Cozystack_EmptyOmitsAppend(t *testi
295301
"advertisedSubnets": []any{testAdvertisedSubnet},
296302
"extraKernelModules": []any{},
297303
})
298-
// Built-in six present.
304+
// Built-in seven present.
299305
assertContains(t, out, "- name: vfio_iommu_type1")
300306
// No empty-list artifact after the built-in tail.
301307
assertNotContains(t, out, "vfio_iommu_type1\n []")
302308
assertNotContains(t, out, "vfio_iommu_type1\n[]")
303-
// Exactly six `- name:` lines inside the modules block: parse the
309+
// Exactly seven `- name:` lines inside the modules block: parse the
304310
// block bounds and count. Anchors `kernel:` / `certSANs:` are the
305311
// adjacent siblings under machine.* in the cozystack chart.
306312
kernelIdx := strings.Index(out, " kernel:")
@@ -314,8 +320,8 @@ func TestContract_Machine_ExtraKernelModules_Cozystack_EmptyOmitsAppend(t *testi
314320
}
315321
block := tail[:endIdx]
316322
gotCount := strings.Count(block, "- name:")
317-
if gotCount != 6 {
318-
t.Errorf("expected 6 modules in kernel.modules block with empty extraKernelModules, got %d\nblock:\n%s", gotCount, block)
323+
if gotCount != 7 {
324+
t.Errorf("expected 7 modules in kernel.modules block with empty extraKernelModules, got %d\nblock:\n%s", gotCount, block)
319325
}
320326
}
321327

‎pkg/engine/testdata/golden/cozystack-controlplane-legacy.golden.yaml‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pkg/engine/testdata/golden/cozystack-controlplane-multidoc.golden.yaml‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pkg/engine/testdata/golden/cozystack-worker-legacy.golden.yaml‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pkg/engine/testdata/golden/cozystack-worker-multidoc.golden.yaml‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)