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.
37 lines
1.2 KiB
Nix
37 lines
1.2 KiB
Nix
# Glue: register the cache container's journal forwarder as an OIDC client
|
|
# wherever authelia runs.
|
|
#
|
|
# ONE PAIRING PER FILE: that forwarder ← authelia, and nothing else.
|
|
# Without it authelia mints no secret, the publisher has nothing to copy into
|
|
# the store, and the forwarder's export is a 401.
|
|
#
|
|
# Gated on authelia being HERE, not on this host running the cache: a client is
|
|
# a row in THIS host's provider config, the split
|
|
# ./glue-forge-otel-oidc-client.nix makes for the same reason.
|
|
{
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
hyperhiveCfg = config.services.hyperhive;
|
|
clientId = hyperhiveCfg.swarm.attic.otel.clientId;
|
|
in
|
|
{
|
|
config = lib.mkIf hyperhiveCfg.deploy.authelia.enable {
|
|
services.hyperhive.swarm.authelia.oidc.clients = [
|
|
{
|
|
id = clientId;
|
|
description = "HyperHive cache journal forwarder";
|
|
kind = "machine";
|
|
redirectUris = [ ];
|
|
# Its own id as its own permitted audience, the one the swarm
|
|
# collector's receiver for this container checks.
|
|
audience = [ clientId ];
|
|
# The receiver verifies the token offline against `/jwks.json`;
|
|
# authelia's default opaque handle fails there.
|
|
accessTokenSignedResponseAlg = "RS256";
|
|
}
|
|
];
|
|
};
|
|
}
|