A shared-central traces store needs each tenant held to a write rate,
or one tenant can fill the disk every tenant shares. No upstream
OpenTelemetry distribution or processor limits throughput. Elastic's
EDOT Collector registers Elastic's ratelimitprocessor among its default
components, but it ships under the Elastic License 2.0 and carries far
more components than the chart uses.
The collector is therefore built here with the OpenTelemetry Collector
Builder from the upstream components the chart already uses, at the
same v0.136.0, plus that ratelimitprocessor (Apache-2.0). Its v0.8.2
is the release built against v0.135.0, the last before v0.137.0. The
image is versioned by the collector release with a cozystack respin
counter, runs as the upstream image's user, and is built with the
other package images.
The builder stage is alpine, which has no git, so a proxy error during
its go install would have had neither the direct fallback nor a retry;
the stage installs git. The module-fetch contract saw only go build, so
it now checks go install too, and takes only git as cover for a
versioned go install, which resolves outside the stage's module.
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
Remove the custom Grafana image build now that the deployment runs on the
upstream grafana/grafana image with catalog plugins. Drops the Dockerfile,
the pinned image tag, the image targets in both monitoring Makefiles, and
the build step from the root Makefile, so ghcr.io/cozystack/cozystack/grafana
is no longer produced or published.
Assisted-By: Claude
Signed-off-by: Andrei Kvapil <andrei.kvapil@aenix.io>
Replace the group-based authorization model on the Phase-1 Grafana
OIDC selector with an app-side users map, mirroring the tenant
kube-apiserver sibling in cozystack/cozystack#3044.
What is removed
- The three chart-owned KeycloakRealmGroup objects in the cozy realm
(`<clientId>-{admin,editor,viewer}`). A Helm release must not own
directory objects — toggling `spec.oidc.mode: System -> None` or
deleting the Monitoring release would Helm-delete the groups, and
with them any membership curated out-of-band. Per-instance groups
in the platform realm is exactly the design question left open at
the end of cozystack/community#24; establishing it as precedent
from a monitoring PR is out of scope.
- Dash-separated group naming (`<namespace>-<release>-<role>`) was
also collision-prone against tenant/subtenant paths, since both
the namespace and release names can themselves contain dashes.
- `role_attribute_path` in the Grafana `generic_oauth` block and the
default-Viewer fallback, which handed org-Viewer to every cozy
realm identity that logged in — cross-tenant metrics read across
every opted-in Grafana. Also removed the `groups` client scope
from the KeycloakClient defaults.
- `monitoring.oidc.allowAssignGrafanaAdmin` helper and the internal
`oidc.grafanaAdmin` values key: the feature was already deferred
and the helper's release-name-only guard was tenant-spoofable.
What replaces it
- `spec.oidc.users: [{email, role: Admin|Editor|Viewer}]` on the
Monitoring chart values.
- A chart-owned post-install/post-upgrade Job
(`templates/grafana/oidc-users-job.yaml`) that reconciles that
list into Grafana's Main Org. via the admin API: pre-provisions
a local Grafana account per listed email so the reconcile can
set the org role before the operator's first OIDC login, adds
the account to the org, PATCHes the role to converge across
re-runs, and prunes every non-admin Main-Org member whose email
is not in the list (handles both entry removal and `mode: None`).
- `skip_org_role_sync = true` + `oauth_allow_insecure_email_lookup
= true` in the generic_oauth block. The former stops a login from
overwriting the Job's assignments; the latter binds the OIDC
identity to the pre-provisioned local account.
- Job talks to Grafana over the in-cluster Service and reads
admin creds from the chart-managed `grafana-admin-password`
Secret via `envFrom`: no ServiceAccount / Role / RoleBinding.
`activeDeadlineSeconds: 900` caps a stuck Job so a broken Grafana
cannot hold the release in `pending-upgrade`.
Defensive rendering
- `.Values.oidc | default dict` in the four templates that dereference
the `oidc` block so `oidc: ~` or an omitted block no longer nil-derefs.
- `oidc-client-secret.yaml` falls back to a fresh random when the
existing Secret lookup succeeds but `data.client-secret` is empty.
Rationale: cozystack/cozystack#3176 review from @lllamnyp
(architectural CHANGES_REQUESTED points 1, 2, 3 + the default-Viewer
leak). The three points stack: dropping the groups incidentally
fixes the naming-collision and the default-Viewer leak, and the
users-Job gives operators the same UX story as the tenant
kube-apiserver PR across both sides of the platform.
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
Refreshes the monitoring image anchors onto current upstream to clear the
published advisories carried by the stale pins.
- grafana image: base grafana/grafana 11.4.0 -> 11.6.15 (latest 11.x). The
rebuild clears the Go-dependency advisories in the grafana binary (x/crypto,
moby/spdystream, jackc/pgx/v5, russellhaering/goxmldsig, buger/jsonparser,
golang-jwt/jwt/v4, getkin/kin-openapi). It stays on the 11.x line rather than
12.x to keep the bundled panel plugins compatible (grafana-worldmap-panel is
deprecated upstream) and avoid a dashboard-schema migration.
- victorialogs-datasource plugin: v0.14.1 -> v0.28.0 (grafanaDependency
>=10.4.0, so it loads on 11.6.15).
- alerta-web: 9.0.4 -> 9.1.0, clearing the python cryptography advisory.
- images/grafana.tag: re-pinned to the rebuilt multi-arch digest.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>