Skip to content

Commit 06ee08f

Browse files
feat(linstor): gate the DRBD sidecar behind drbd.enabled
On a substrate where the DRBD kernel module is unavailable the drbd-logger sidecar exits immediately, the satellite pod is therefore never Ready, and piraeus consequently registers zero nodes: LINSTOR reports none, linstor-csi-node hangs in Init polling for a node that does not exist, and every PVC stays Pending behind a cluster that looks healthy. So this flag is the difference between working storage and no storage at all there, not a cosmetic reduction in logging. The concrete case is Talos nodes running as containers. DRBD's resource registry is global per kernel, so three containers sharing one kernel cannot represent three DRBD nodes -- the second new-resource for a given name silently aliases the first instead of failing, which is worse than an error because LINSTOR then records a replica it does not have. It applies to kind equally; it is a property of one kernel, not of Talos. Omitting the sidecar from Cozystack's own pod template is not enough, because piraeus strategically merges satellite configurations and a container another configuration contributes survives the omission. So a LinstorSatelliteConfiguration deletes it from the effective DaemonSet as well. What the flag does NOT do is touch a StorageClass, and the comment says so explicitly. Cozystack does not own them -- an operator writes them by hand from the install guide -- so a class carrying layerList: "drbd storage" still exists after setting this false and volumes on it will never provision. The operator-facing half of that warning goes beside the examples they copy, in cozystack/website#675. Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 7b0c35b commit 06ee08f

4 files changed

Lines changed: 128 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if not .Values.drbd.enabled }}
2+
apiVersion: piraeus.io/v1
3+
kind: LinstorSatelliteConfiguration
4+
metadata:
5+
name: cozystack-no-drbd
6+
spec:
7+
# podTemplate is a sparse strategic-merge input. Omitting a container there
8+
# does not delete one contributed by another configuration or retained in the
9+
# effective Satellite spec, so remove the DRBD-only logger from the generated
10+
# DaemonSet explicitly.
11+
patches:
12+
- target:
13+
group: apps
14+
version: v1
15+
kind: DaemonSet
16+
name: linstor-satellite
17+
patch: |
18+
apiVersion: apps/v1
19+
kind: DaemonSet
20+
metadata:
21+
name: linstor-satellite
22+
spec:
23+
template:
24+
spec:
25+
containers:
26+
- name: drbd-logger
27+
$patch: delete
28+
{{- end }}

‎packages/system/linstor/templates/satellites-plunger.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ spec:
5858
- mountPath: /scripts
5959
name: script-volume
6060
readOnly: true
61+
{{- if .Values.drbd.enabled }}
6162
- name: drbd-logger
6263
image: {{ .Values.piraeusServer.image.repository }}:{{ .Values.piraeusServer.image.tag }}
6364
resources:
@@ -87,6 +88,7 @@ spec:
8788
- mountPath: /scripts
8889
name: script-volume
8990
readOnly: true
91+
{{- end }}
9092
volumes:
9193
- name: script-volume
9294
configMap:

‎packages/system/linstor/tests/satellites_test.yaml‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ suite: satellite pod resource limits
1515

1616
templates:
1717
- templates/satellites-cozy.yaml
18+
- templates/satellites-no-drbd.yaml
1819
- templates/satellites-plunger.yaml
1920

2021
tests:
@@ -37,3 +38,69 @@ tests:
3738
- equal:
3839
path: spec.podTemplate.spec.containers[?(@.name=="drbd-logger")].resources.limits.memory
3940
value: 128Mi
41+
42+
# `drbd.enabled: false` is the difference between working storage and NO
43+
# storage on a substrate without DRBD, not a logging preference: the sidecar
44+
# exits immediately when the module is absent, the satellite pod is then never
45+
# Ready, and piraeus consequently registers zero nodes — so every PVC hangs
46+
# Pending behind a cluster that otherwise looks healthy.
47+
#
48+
# Asserted by container count and name rather than a negated `contains`: a
49+
# negation against a path that no longer resolves passes vacuously, so it would
50+
# go on passing if the containers list vanished entirely.
51+
- it: both plunger sidecars are present by default
52+
template: templates/satellites-plunger.yaml
53+
asserts:
54+
- lengthEqual:
55+
path: spec.podTemplate.spec.containers
56+
count: 2
57+
- equal:
58+
path: spec.podTemplate.spec.containers[0].name
59+
value: plunger
60+
- equal:
61+
path: spec.podTemplate.spec.containers[1].name
62+
value: drbd-logger
63+
64+
- it: drbd-logger is omitted when the substrate cannot run DRBD
65+
template: templates/satellites-plunger.yaml
66+
set:
67+
drbd.enabled: false
68+
asserts:
69+
- lengthEqual:
70+
path: spec.podTemplate.spec.containers
71+
count: 1
72+
- equal:
73+
path: spec.podTemplate.spec.containers[0].name
74+
value: plunger
75+
# the surviving sidecar must keep its limit, or the whole pod re-enters the
76+
# Talos OOM handler's victim set that this suite exists to guard
77+
- equal:
78+
path: spec.podTemplate.spec.containers[0].resources.limits.memory
79+
value: 128Mi
80+
81+
- it: no DaemonSet deletion patch is emitted on a DRBD-capable substrate
82+
template: templates/satellites-no-drbd.yaml
83+
asserts:
84+
- hasDocuments:
85+
count: 0
86+
87+
- it: drbd-logger is deleted from the effective DaemonSet without DRBD
88+
template: templates/satellites-no-drbd.yaml
89+
set:
90+
drbd.enabled: false
91+
asserts:
92+
- isKind:
93+
of: LinstorSatelliteConfiguration
94+
- equal:
95+
path: metadata.name
96+
value: cozystack-no-drbd
97+
- equal:
98+
path: spec.patches[0].target
99+
value:
100+
group: apps
101+
version: v1
102+
kind: DaemonSet
103+
name: linstor-satellite
104+
- matchRegex:
105+
path: spec.patches[0].patch
106+
pattern: '(?s)containers:\s*- name: drbd-logger\s*\$patch: delete'

‎packages/system/linstor/values.yaml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@ piraeusServer:
55
# Talos-specific workarounds (disable for generic Linux like Ubuntu/Debian)
66
talos:
77
enabled: true
8+
# Whether the node substrate can run DRBD at all.
9+
#
10+
# Disable on any substrate where the DRBD kernel module is unavailable or
11+
# unusable. The concrete case is Talos nodes running as containers: DRBD's
12+
# resource registry is global per kernel, so three containers sharing one kernel
13+
# cannot represent three DRBD nodes — the second `new-resource` for a given name
14+
# silently aliases the first instead of failing, which is worse than an error
15+
# because LINSTOR records a replica it does not have.
16+
#
17+
# What this flag does, and all it does: the `drbd-logger` sidecar is omitted from
18+
# Cozystack's sparse pod template and deleted explicitly from the effective
19+
# DaemonSet. Omission alone is not enough because piraeus strategically merges
20+
# satellite configurations. That sidecar tails DRBD state and exits immediately
21+
# when the module is absent, and because the whole satellite pod is then never
22+
# Ready, piraeus never registers the node: LINSTOR reports zero nodes,
23+
# `linstor-csi-node` hangs in Init polling for a node that does not exist, and
24+
# every PVC stays Pending. So this flag is the difference between working storage
25+
# and no storage at all on such a substrate, not a cosmetic reduction in logging.
26+
#
27+
# What it does NOT do: it does not touch a StorageClass. Cozystack does not own
28+
# them — an operator writes them by hand from the install guide — so a class
29+
# carrying `linstor.csi.linbit.com/layerList: "drbd storage"` still exists after
30+
# setting this false, and volumes on it will never provision. On such a substrate
31+
# create only storage-only, node-pinned classes (`layerList: "storage"`,
32+
# `allowRemoteVolumeAccess: "false"`); the install docs say so beside the
33+
# examples.
34+
#
35+
# Leaving it true on a DRBD-capable node is always correct; this only ever needs
36+
# disabling where DRBD genuinely cannot work.
37+
drbd:
38+
enabled: true
839
linstor:
940
autoDiskful:
1041
enabled: true

0 commit comments

Comments
 (0)