Watch
0
0
Fork
You've already forked hyperhive
0

run grafana as a pod in the cluster

The Deployment swarm-grafana replaces the swarm-grafana container: one
replica on a static local volume that is the container's data directory,
an init container that fetches the OIDC client secret and creates the
administrator password, the datasources' bearer and the encryption key in
the secret store, and a sidecar that keeps the controller's Viewer token.
The datasources reach the stores through the gateway with that bearer, and
Grafana's /metrics asks for the stores' kind of credential, which the vhost
sends. The five host units, the journal forwarder, its client glue and the
unix-socket directory go with the container.
This commit is contained in:
atlas 2026-11-27 22:51:25 +01:00
commit 9f62e71dae

View file

@ -1,6 +1,6 @@
# The swarm's metrics UI as every hive sees it: the name it is served under
# and the OIDC client it is registered as, identical on every host. What the
# host running it decides, and the container itself, are in
# host running it decides, and its pod, are in
# ./swarm-grafana.nix.
{
lib,
@ -23,38 +23,9 @@ in
# Here is what the service IS to every hive: the name it is served under
# and the OIDC client it is registered as. What the host running it
# decides — which build it runs, where its datasources point, which plugins
# are in its store path, and the socket directory it shares with nginx — is
# are in its store path — is
# `deploy.grafana`, in ./swarm-grafana.nix.
options.services.hyperhive.swarm.grafana = {
machine = lib.mkOption {
type = lib.types.str;
readOnly = true;
default = "swarm-grafana";
description = ''
Container name. Read-only: the name appears in host paths and in
`machinectl`, so it is a fact other modules may read rather than a
knob.
'';
};
otel.clientId = lib.mkOption {
type = lib.types.str;
readOnly = true;
default = "swarm-grafana-collector";
description = ''
OAuth2 client id the journal forwarder inside Grafana's container
authenticates as, and the audience it asks its token for. Its own,
not {option}`services.hyperhive.swarm.grafana.oidc.clientId`, which
is the browser login's.
Read-only because three hosts have to agree on it: authelia
registers the client (`glue-grafana-otel-oidc-client.nix`), the
swarm collector admits it on the container's receiver
(`swarm.otel.serviceProducers`), and authelia's mint stores
its secret in the store.
'';
};
domain = lib.mkOption {
type = lib.types.str;
default = "grafana.${domainBase}";
@ -98,8 +69,8 @@ in
OAuth callback authelia sends the browser back to, and the URI it
matches **exactly**.
Read-only, like {option}`services.hyperhive.swarm.grafana.machine`
and for the same reason: Grafana derives it from its own
Read-only
because Grafana derives it from its own
`root_url` (`<root_url>/login/generic_oauth`), so it is a fact
other modules may read rather than a knob. The glue that registers
this client wherever authelia runs reads it from here instead of