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:
parent
9f62e71dae
commit
bd0cff47f9
1 changed files with 429 additions and 91 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue