Watch
0
0
Fork
You've already forked hyperhive
0

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:
atlas 2026-11-27 22:51:25 +01:00
commit 9f62e71dae

View file

@ -32,6 +32,7 @@ A service gets manifests on the host whose configuration deploys it:
| `swarm-logs-auth` | Deployment | ServiceAccount, two Services, NetworkPolicy |
| `swarm-victoriametrics` | Deployment | Service, NetworkPolicy, PersistentVolume and Claim |
| `swarm-metrics-auth` | Deployment | ServiceAccount, two Services, NetworkPolicy |
| `swarm-grafana` | Deployment | ServiceAccount, Service, NetworkPolicy, PersistentVolume and Claim |
`namespace.yaml` holds the Namespace ([Pod Security](#pod-security)), and
`default-deny-ingress/networkpolicy.yaml` its default-deny ingress policy
@ -150,15 +151,17 @@ credential directory.
in the container, with a 5-second timeout, and a 503 fails it. The pod
declares no port for the listener. `swarm-controller` is one of
them, with `SWARM_CONTROLLER_HEALTH_ADDR`. A third-party daemon with no health variable,
`victoria-logs` and `victoria-metrics`, names a `probe` path instead (`/health`), which both probes
request on its listener. A `startupFailureThreshold` in it (`victoria-metrics`, 60) adds a
`victoria-logs`, `victoria-metrics` and `grafana`, names a `probe` path instead (`/health`; `/api/health` for `grafana`), which both probes
request on its listener. A `startupFailureThreshold` in it (`victoria-metrics`, 60, and `grafana`, 30) adds a
startup probe on the same path, tried every ten seconds, before the other two begin.
The health listener of our own daemons is unreachable from outside the pod: the
node, other pods and the bridge get a refusal, so it needs no credential.
The one health route outside the pod is the `/health` of `victoria-logs` and
`victoria-metrics` on their main port. Upstream answers `/health`, `/ping`,
`/-/healthy` and `/-/ready` before it checks `-httpAuth`, and the gateway needs
the main port on the pod's IP, so no bind or probe can close it. It's
The health routes outside the pod are the `/health` of `victoria-logs` and
`victoria-metrics` on their main port, and the `/api/health` and `/healthz` of
Grafana on its own. Upstream answers `/health`, `/ping`, `/-/healthy` and
`/-/ready` before it checks `-httpAuth`, Grafana answers its two before its
login, and the gateway needs the main port on the pod's IP, so no bind or
probe can close them. It's
reachable from the node only, through the default-deny ingress policy, and it
returns a status and no data.
- **Listener and init container:** a service with a TCP `listener`
@ -167,7 +170,7 @@ credential directory.
gets an init container and a renewal container that issue its leaf into an
`emptyDir` ([runtime](runtime.md#the-controller)). The image of those
containers is part of `system.build.k8sImages`. A listener with no `tlsDir`
(`swarm-victorialogs`, `swarm-logs-auth`, `swarm-victoriametrics`, `swarm-metrics-auth`) serves plain HTTP: it gets the
(`swarm-victorialogs`, `swarm-logs-auth`, `swarm-victoriametrics`, `swarm-metrics-auth`, `swarm-grafana`) serves plain HTTP: it gets the
Service and the policy and no leaf, init container or renewal container.
- **More than the daemon:** a service whose pod holds more than its daemon
(the queue, whose server and exporter run beside the responder) names a
@ -179,9 +182,11 @@ credential directory.
holds two store roles has both bound to it
([runtime](runtime.md#the-queue)). The responders' pods of the log and metrics
stores hold a second container the same way
([runtime](runtime.md#the-log-store), [runtime](runtime.md#the-metrics-store)).
([runtime](runtime.md#the-log-store), [runtime](runtime.md#the-metrics-store)),
and Grafana's pod holds an init container and a sidecar
([runtime](runtime.md#the-grafana-pod)).
- **A unit of the module's own making:** a service that never ran under systemd on the
host (`swarm-victorialogs`, `swarm-logs-auth`, `swarm-victoriametrics`, `swarm-metrics-auth`) gives the renderer the
host (`swarm-victorialogs`, `swarm-logs-auth`, `swarm-victoriametrics`, `swarm-metrics-auth`, `swarm-grafana`) gives the renderer the
`serviceConfig`, `environment` and `path` of one as a plain attribute set, with
the daemon's flags as a list in `ExecStart`. The renderer reads nothing else of
a unit. `fsGroupChangePolicy` in the entry sets the pod's field of that name.