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
feat(cozystack): add DRBD-oriented sysctl and etcd backend defaults
Cozystack nodes always run DRBD (the drbd module is loaded
unconditionally), and DRBD reconnect storms — node reboots, resync —
exhaust TCP ports under the default Talos sysctl profile. Ship the
network tuning that resolved this on production clusters, plus a
tunable etcd backend quota for LINSTOR-heavy control planes.
Always-on machine.sysctls (cozystack preset):
- tcp_orphan_retries=3, tcp_fin_timeout=30 reclaim orphaned and
FIN-WAIT sockets faster so a reconnect storm cannot outrun cleanup.
- netdev_max_backlog/budget/budget_usecs widen the receive backlog so
bursty replication traffic isn't dropped under load.
Opt-in machine.sysctls tcp_keepalive_{time,intvl,probes}, gated by
tcpKeepaliveTuning (default off): the triplet is kernel-wide and
shortens idle-socket failure detection for every long-lived TCP
connection on the node, not just DRBD. DRBD already detects dead peers
in seconds via its own protocol-level ping, so this is a generic
socket backstop rather than a DRBD requirement — hence off by default.
cluster.etcd.extraArgs.quota-backend-bytes, tunable via
etcd.quotaBackendBytes (default 8GiB, etcd's documented upper bound):
raises etcd's 2GiB backend ceiling so a control plane holding many
DRBD-resource CRDs in aggregate does not trip the NOSPACE alarm. It is
a ceiling not a reservation, emitted only on controlplane nodes; blank
it to fall back to etcd's own default. This governs total DB size, not
single-object size — per-object writes stay bounded by kube-apiserver's
fixed 3MiB request-body limit, which has no configuration knob.
The extraSysctls collision guard now covers the new preset-owned keys
(the keepalive triplet only while the toggle is on), and the manual
test plan gains a scenario exercising every branch.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
{{- 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
+46-1Lines changed: 46 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -277,7 +277,7 @@ Expected:
277
277
278
278
-`.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
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.
280
+
-`.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.
281
281
-`.machine.files[].path` lists `/etc/cri/conf.d/20-customization.part`, `/etc/lvm/lvm.conf`, AND `/etc/example/operator.conf`.
282
282
283
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:
@@ -316,6 +316,51 @@ Expected: all four prints "OK". Set any single `extra*` key non-empty, re-render
316
316
317
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.
The cozystack preset ships always-on DRBD/LINSTOR network sysctls, an opt-in aggressive TCP-keepalive triplet, and a tunable etcd backend quota. Render the cozystack controlplane preset at defaults:
-`.machine.sysctls` does NOT contain any `net.ipv4.tcp_keepalive_*` key — the triplet is opt-in (`tcpKeepaliveTuning: false` by default).
333
+
-`.cluster.etcd.extraArgs.quota-backend-bytes` is `"8589934592"` (8 GiB) on a controlplane render.
334
+
335
+
Render the worker preset (`yq '.cluster.etcd' /tmp/render-worker.yaml` → `null`): the whole `etcd` block, and thus `quota-backend-bytes`, is controlplane-only.
336
+
337
+
Enable the keepalive triplet and lower the etcd quota:
338
+
339
+
```yaml
340
+
# values.yaml additions:
341
+
tcpKeepaliveTuning: true
342
+
etcd:
343
+
quotaBackendBytes: "2147483648"# 2 GiB
344
+
```
345
+
346
+
Re-render and verify:
347
+
348
+
- `.machine.sysctls` now also carries `net.ipv4.tcp_keepalive_time: "600"`, `net.ipv4.tcp_keepalive_intvl: "10"`, `net.ipv4.tcp_keepalive_probes: "6"`.
349
+
- `.cluster.etcd.extraArgs.quota-backend-bytes`is now `"2147483648"`.
350
+
351
+
Blank the quota to fall back to etcd's own default:
Expected: `null`— a blank quota omits the `extraArgs` block entirely rather than emitting an empty value.
359
+
360
+
Collision check: with `tcpKeepaliveTuning: true`, set `extraSysctls: { "net.ipv4.tcp_keepalive_time": "1200" }` and re-render — the render fails with the `collides with the cozystack preset's built-in machine.sysctls` error (the keepalive keys become preset-owned once the toggle is on). With `tcpKeepaliveTuning: false`, the same `extraSysctls` entry is accepted and renders as the sole keepalive sysctl.
361
+
362
+
Regression anchor: `TestContract_Machine_Sysctls_DRBDTuning_Cozystack`, `TestContract_Machine_Sysctls_TCPKeepalive_*`, and `TestContract_Cluster_Etcd_QuotaBackendBytes_*` pin every branch above; `TestContract_Machine_Sysctls_DRBDTuning_AbsentOnGeneric` / `TestContract_Cluster_Etcd_QuotaBackendBytes_AbsentOnGeneric` pin that the generic preset stays free of these opinions.
363
+
319
364
## C. Apply (auth path)
320
365
321
366
This section is the smoke-test for the apply pipe itself; the per-gate matrix lives in **Section C-safety** below.
0 commit comments