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
|
|
@ -124,15 +124,14 @@ symptom many layers from its cause.
|
|||
|
||||
The store's **first reader** is Grafana's OIDC client secret, a _swarm
|
||||
service's_ own credential rather than a hive's. It has exactly
|
||||
one delivery route: `swarm-bao-grafana-oidc.service` reads
|
||||
`swarm/services/<client-id>/oidc/client` out of the store, on **every** host
|
||||
that runs Grafana. Where authelia is doesn't enter into it — the mint in
|
||||
one delivery route: the init container `fetch-secrets` of Grafana's pod reads
|
||||
`swarm/services/<client-id>/oidc/client` out of the store with the pod's
|
||||
ServiceAccount token, on the host that runs the pod. Where authelia is doesn't enter into it — the mint in
|
||||
authelia's container writes that path whether the reader is a network away or
|
||||
in the container next door. On a fresh swarm the mint writes it a moment after
|
||||
the reader's first attempt, so a read that finds no value yet fails and the
|
||||
unit asks again every 30 seconds until the value is there, as the forge's and
|
||||
the homeserver's do. A unit that finished there would wait for its refresh
|
||||
timer, about ten minutes on.
|
||||
the reader's first attempt, so a read that finds no value yet fails the
|
||||
container and the kubelet starts it again, with a growing delay, until the
|
||||
value is there. The forge's and the homeserver's units retry the same way.
|
||||
|
||||
That's a deliberate refusal of the shortcut. Copying the plaintext
|
||||
straight out of authelia's tree when the two happen to share a host is one
|
||||
|
|
@ -163,12 +162,13 @@ the option pair, when that leaf is unset — neither the responder nor the
|
|||
homeserver starts without its secret, and the forge registers no login source
|
||||
without its.
|
||||
|
||||
Grafana's admin password rides the same leaf and the same store. Where Grafana
|
||||
and the store run on different hosts, deploy the store's host first:
|
||||
`swarm-bao-grafana-oidc-policy` there writes the grant that lets Grafana create
|
||||
the password, and until it has, the store refuses `swarm-bao-grafana-admin` on
|
||||
the Grafana host, which retries, while Grafana stays down because its config
|
||||
reads that file.
|
||||
Grafana's admin password, datasource bearer and encryption key ride the same role
|
||||
and the same store. Where Grafana and the store run on different hosts, deploy the store's
|
||||
host first: `swarm-bao-grafana-oidc-policy` there writes the grant that lets Grafana create
|
||||
them, and until it has, the store refuses `fetch-secrets`, which fails and retries while
|
||||
Grafana stays down because its config reads those files. The pod reads them once, when it
|
||||
starts: a replaced value takes effect after
|
||||
`kubectl -n hyperhive rollout restart deployment/swarm-grafana`.
|
||||
|
||||
The **second reader** is the swarm collector's own OIDC client secret, the
|
||||
same shape one level down: `swarm-bao-otel-oidc.service` reads
|
||||
|
|
|
|||
Loading…
Reference in a new issue