Skip to content

Commit e8779e4

Browse files
committed
refactor(monitoring): keep the HelmRelease rationale in template comments
The timeout, waitStrategy and healthCheckExprs rationale in the monitoring-system HelmRelease was written as `#` comments, which Helm renders verbatim, so every tenant's HelmRelease carried about thirty lines of prose. Move it into template comments like the traces paragraph beside it: the reasoning stays in the chart source and the rendered object is unchanged apart from losing the comments. Signed-off-by: Alexey Artamonov <[email protected]> Assisted-by: LLM
1 parent 2682185 commit e8779e4

1 file changed

Lines changed: 35 additions & 30 deletions

File tree

‎packages/extra/monitoring/templates/helmrelease.yaml‎

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,54 @@ spec:
1010
name: cozystack-monitoring-application-default-monitoring-system
1111
namespace: cozy-system
1212
interval: 5m
13-
# Aligned with the outer cozyrds `release.cozystack.io/helm-install-timeout: "15m"`
14-
# (packages/system/monitoring-rd/cozyrds/monitoring.yaml) so the inner HR does
15-
# not fail at 10m while the OIDC users-Job is still inside its
16-
# activeDeadlineSeconds: 900 (10m Grafana wait + reconcile budget).
13+
{{- /*
14+
Aligned with the outer cozyrds `release.cozystack.io/helm-install-timeout: "15m"`
15+
(packages/system/monitoring-rd/cozyrds/monitoring.yaml) so the inner HR does
16+
not fail at 10m while the OIDC users-Job is still inside its
17+
activeDeadlineSeconds: 900 (10m Grafana wait + reconcile budget).
18+
*/}}
1719
timeout: 15m
1820
install:
1921
remediation:
2022
retries: -1
2123
upgrade:
2224
remediation:
2325
retries: -1
24-
# `poller` waitStrategy is required for healthCheckExprs to be evaluated.
25-
# Without it the HR flips Ready as soon as helm applies the VLCluster CR,
26-
# before the victoria-metrics-operator has stood up the log store — which is
27-
# exactly how a missing/broken VictoriaLogs stayed invisible (issue #3181:
28-
# fluent-bit drops logs at a dead-end vlinsert-generic while the release is
29-
# Ready). Gating on the VLCluster's own status makes that failure loud.
26+
{{- /*
27+
`poller` waitStrategy is required for healthCheckExprs to be evaluated.
28+
Without it the HR flips Ready as soon as helm applies the VLCluster CR,
29+
before the victoria-metrics-operator has stood up the log store, which is
30+
exactly how a missing/broken VictoriaLogs stayed invisible (issue #3181:
31+
fluent-bit drops logs at a dead-end vlinsert-generic while the release is
32+
Ready). Gating on the VLCluster's own status makes that failure loud.
33+
*/}}
3034
waitStrategy:
3135
name: poller
32-
# VLCluster's status.conditions carry no stable Ready-type contract for this
33-
# operator version, so key on status.updateStatus instead. The CRD types it
34-
# as a free-form string; the operator's known values are operational,
35-
# expanding, failed and paused. Map `operational` -> current and `expanding`
36-
# -> in-progress; the `failed` predicate is a catch-all for everything else
37-
# (the operator's `failed` and `paused`, plus any future/unknown value), so
38-
# an unexpected status can never be silently read as Ready. A paused or
39-
# failed log store is not ingesting, so the release must not report Ready;
40-
# cozystack never sets spec.paused on these VLClusters, so `paused` is not
41-
# reachable in normal operation. Before the operator writes any updateStatus
42-
# (fresh apply) all three predicates are false, so the poller holds the
43-
# release not-ready until it becomes operational or hits `timeout:` — the
44-
# real backstop. Matching by kind covers every logsStorages entry. (CEL
45-
# evaluation is exercised live, not in helm-unittest, which cannot run it.)
46-
#
47-
# The gate keys on a VLCluster existing, so an empty logsStorages would leave
48-
# nothing to match. That configuration is rejected at render time by the
49-
# system/monitoring chart (templates/vlogs/vlogs.yaml fails on an empty
50-
# logsStorages), so the "Ready with no log store" hole cannot be reached.
5136
{{- /*
37+
VLCluster's status.conditions carry no stable Ready-type contract for this
38+
operator version, so key on status.updateStatus instead. The CRD types it
39+
as a free-form string; the operator's known values are operational,
40+
expanding, failed and paused. `operational` maps to current and `expanding`
41+
to in-progress; the `failed` predicate is a catch-all for everything else
42+
(the operator's `failed` and `paused`, plus any future/unknown value), so
43+
an unexpected status can never be silently read as Ready. A paused or
44+
failed log store is not ingesting, so the release must not report Ready;
45+
cozystack never sets spec.paused on these VLClusters, so `paused` is not
46+
reachable in normal operation. Before the operator writes any updateStatus
47+
(fresh apply) all three predicates are false, so the poller holds the
48+
release not-ready until it becomes operational or hits `timeout:`, the
49+
real backstop. Matching by kind covers every logsStorages entry. (CEL
50+
evaluation is exercised live, not in helm-unittest, which cannot run it.)
51+
52+
The gate keys on a VLCluster existing, so an empty logsStorages would leave
53+
nothing to match. That configuration is rejected at render time by the
54+
system/monitoring chart (templates/vlogs/vlogs.yaml fails on an empty
55+
logsStorages), so the "Ready with no log store" hole cannot be reached.
56+
5257
The traces backend (VTCluster / VTSingle) shares this operator and the same
5358
status.updateStatus contract, so it is gated identically below. Unlike logs,
5459
tracingStorages is EMPTY by default (tracing off), so usually nothing renders
55-
and these exprs are inert — Flux evaluates them only against CRs in the
60+
and these exprs are inert: Flux evaluates them only against CRs in the
5661
release inventory. "Ready with no trace store" is intentional and harmless:
5762
nothing produces spans until the collector ships, so no data is dropped
5863
(hence no fail-on-empty guard yet, unlike the logs #3181 guard which fires

0 commit comments

Comments
 (0)