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:
parent
26ef09b0d7
commit
9f62e71dae
1 changed files with 1938 additions and 1953 deletions
|
|
@ -344,6 +344,38 @@ let
|
|||
egress = [ "store" ];
|
||||
otlp = "none";
|
||||
};
|
||||
# Grafana: the swarm's metrics UI, on a static local volume that is its
|
||||
# data directory. Its configuration, provisioning and plugins are in the
|
||||
# image; an init container fetches its secrets and a sidecar keeps the
|
||||
# controller's token (`pod`). It logs in to nothing itself and pushes no
|
||||
# telemetry. The UI and the API take Grafana's own login; its `/metrics`
|
||||
# takes the listener credential.
|
||||
swarm-grafana = {
|
||||
inherit (deployCfg.grafana) enable unit pod;
|
||||
package = deployCfg.grafana.startPackage;
|
||||
kind = "Deployment";
|
||||
healthEnv = null;
|
||||
probe = {
|
||||
path = "/api/health";
|
||||
startupFailureThreshold = 30;
|
||||
};
|
||||
etcFiles = [ ];
|
||||
publicCredentials."bao-ca.pem" = baoServerCaKey;
|
||||
listener.port = deployCfg.grafana.servicePort;
|
||||
# The secret store, and the gateway's 443: authelia's token and userinfo
|
||||
# routes and both datasources.
|
||||
egress = [
|
||||
"store"
|
||||
"identity"
|
||||
];
|
||||
baoRole = "swarm-grafana-oidc";
|
||||
localState = {
|
||||
service = "grafana";
|
||||
hostDir = deployCfg.grafana.hostDataDir;
|
||||
};
|
||||
fsGroupChangePolicy = "OnRootMismatch";
|
||||
otlp = "none";
|
||||
};
|
||||
};
|
||||
|
||||
# Where a pod pushes telemetry. A `"hive"` service pushes to the hive
|
||||
|
|
|
|||
Loading…
Reference in a new issue