Declarative Grafana / Prometheus / Loki / Tempo observability stack

Deploys the whole stack into the observability namespace of the local
cluster with Kustomize alone — no helm install, no dashboard created by
hand in the UI. The Makefile carries every command: deploy, dashboards,
diagnostics, PVC flush, teardown.

Dashboards are files, never UI objects. Each carries a stable uid, which
is what keeps URLs, cross-links and alerts alive across redeployments, and
references datasources by stable uid rather than by name. The dashboard
ConfigMap is generated without a name-suffix hash so applying it updates
it in place and Grafana reloads without a restart, while the provisioning
ConfigMaps keep their hash precisely so that a change there does force one.

Prometheus scrapes the kubelet /metrics/resource endpoint rather than
/metrics/cadvisor: on this cluster cadvisor exposes machine_* series only
and no container_* at all, which would leave every CPU and memory panel
empty.

Alloy ships every pod's logs to Loki through the Kubernetes API, so no
/var/log mount is needed. Tempo's metrics_generator feeds span metrics and
the service graph back into Prometheus, and the datasources are wired so a
log line's trace_id opens the matching trace.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Stéphane Tailland
2026-08-25 07:27:38 +02:00
commit 3937b4f366
42 changed files with 7597 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# Certificates issued by the `sttlab-local-ca` cert-manager ClusterIssuer
# (already present on the cluster). No private key is ever versioned.
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: observability-tls
namespace: observability
labels:
app.kubernetes.io/part-of: observability
spec:
secretName: observability-tls
issuerRef:
name: sttlab-local-ca
kind: ClusterIssuer
commonName: grafana.sttlab.local
dnsNames:
- grafana.sttlab.local
- prometheus.sttlab.local
- alloy.sttlab.local
- loki.sttlab.local
- tempo.sttlab.local
+88
View File
@@ -0,0 +1,88 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: grafana
namespace: observability
labels:
app.kubernetes.io/name: grafana
app.kubernetes.io/part-of: observability
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "20m"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
# Required for TraceQL streaming and Loki live tail.
nginx.ingress.kubernetes.io/proxy-buffering: "off"
spec:
ingressClassName: nginx
tls:
- hosts:
- grafana.sttlab.local
secretName: observability-tls
rules:
- host: grafana.sttlab.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: grafana
port:
number: 3000
---
# Exposed for diagnostics (targets, TSDB status, expression browser).
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: prometheus
namespace: observability
labels:
app.kubernetes.io/name: prometheus
app.kubernetes.io/part-of: observability
annotations:
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
spec:
ingressClassName: nginx
tls:
- hosts:
- prometheus.sttlab.local
secretName: observability-tls
rules:
- host: prometheus.sttlab.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: prometheus
port:
number: 9090
---
# Alloy UI: state of the log collection pipeline components.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: alloy
namespace: observability
labels:
app.kubernetes.io/name: alloy
app.kubernetes.io/part-of: observability
spec:
ingressClassName: nginx
tls:
- hosts:
- alloy.sttlab.local
secretName: observability-tls
rules:
- host: alloy.sttlab.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: alloy
port:
number: 12345
+7
View File
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: observability
resources:
- certificate.yaml
- ingress.yaml