Watch
0
0
Fork
You've already forked hyperhive
0

keep the container's secret key through the pod's first start

Grafana wraps the data keys of its database with secret_key, and a different
key makes them undecryptable, which grafana cli's re-encrypt cannot repair
(it decrypts with the current key first). So the init container takes the
store's key, else the file the container generated, else a new key, and a new
key only over a database that holds no data_keys row; otherwise it exits
non-zero naming the leaf. The file reaches it read-only through a claim on a
static local volume, because the namespace refuses a hostPath.
This commit is contained in:
atlas 2026-11-28 00:21:37 +01:00
commit bd0cff47f9

View file

@ -1298,7 +1298,7 @@ let
in
ds.jsonData.httpHeaderName1 == "Authorization"
&& ds.secureJsonData.httpHeaderValue1 == "$__file{/run/grafana-secrets/metrics-bearer}"
&& lib.hasInfix "put metrics-bearer \"Bearer $(seeded secret/${leaf})\"" fetch
&& lib.hasInfix "bearer=\"$(seeded secret/${leaf})\"\nput metrics-bearer \"Bearer $bearer\"" fetch
&& builtins.elem leaf (lib.findFirst (c: c.name == "grafana-auth") null metricsPod.containers).args
&& lib.hasInfix "path \"secret/data/${leaf}\" {\n capabilities = [\"read\"]\n}" s.swarm-bao-metrics-auth-policy.script
&& lib.hasInfix "path \"secret/data/${leaf}\" {\n capabilities = [\"create\", \"read\"]\n}" s.swarm-bao-grafana-oidc-policy.script;