Files
cozystack/packages/apps/tenant/tests
IvanHunters 0b119ea18b fix(tenant): ship sub-tenant logs and metrics to the monitoring owner at any depth
A tenant whose monitoring resolves to an ancestor runs Fluent Bit and
VMAgent that write logs to the owner's vlinsert and metrics to its
vminsert. The generated Cilium egress dropped part of this traffic: it
never opened vlinsert, so log shipping was always dropped at the source,
and it reached vminsert only by walking the namespace prefix, which never
reaches tenant-root from below the first level, so a guest two levels deep
under a tenant-root-owned monitoring lost its metrics.

Replace the prefix walk with a single egress rule that targets the
monitoring owner namespace directly for both vminsert and vlinsert. The
owner is already computed in namespace.yaml and inherited through
_namespace.monitoring, so it resolves at any depth, and the rule is
skipped when the tenant owns its monitoring or when no ancestor owns it.
The owner already admits the traffic through allow-external-communication
(fromEntities: cluster), so no ingress policy is added.

The etcd and ingress ancestor egress now comes from
tenant.ancestorNamespaces (merged separately onto main), so the monitoring
tests assert that shape and the ancestor-egress suite no longer asserts the
removed vminsert prefix-walk rule.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-12-03 11:45:34 +03:00
..