Files
cozystack/packages/apps
Mattia Eleuteri 64fa40e255 feat(monitoring): add destinations to the agents without replacing the defaults
Sending a copy of metrics or logs to a store of one's own meant
overriding vmagent.remoteWrite.urls or fluent-bit.config.outputs. Both
are replaced wholesale on merge, a list and a single string, so the
override had to restate the platform's own destinations, and one that
did not silently cut the tenant's VictoriaMetrics and VictoriaLogs off.
A plain URL list could not carry credentials either.

vmagent.extraRemoteWrite takes VMAgent remoteWrite entries appended
after urls and passed as is, so an entry can carry basicAuth,
bearerTokenSecret, headers or tlsConfig. fluent-bit.config.extraOutputs
takes [OUTPUT] sections appended by the outputs template itself, which
the fluent-bit subchart renders with tpl, so .Values there is the
subchart's own. The managed Kubernetes app replaces outputs for tenant
clusters, so its outputs carry the same hook, escaped to survive the
app chart's render. On a tenant cluster both are set through
addons.monitoringAgents.valuesOverride.

With neither key set, the system chart render and the tenant render
(app HelmRelease values fed to the system chart) are byte-identical to
before. Unit tests cover both keys in the system chart and the hook in
the tenant HelmRelease; each fails without the change.

Both charts refuse to render when extraOutputs is set and the
effective outputs does not emit it, so an outputs override that drops
the hook fails loudly instead of losing the extra destinations.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-23 11:58:49 +03:00
..
2025-08-07 14:07:05 +03:00

How to test packages local

cd packages/core/installer
make image-cozystack REGISTRY=YOUR_CUSTOM_REGISTRY
make apply
kubectl delete po -l app=source-controller -n cozy-fluxcd