Skip to content

Prometheus & Grafana

The observability stack is deployed as a single kube-prometheus-stack HelmRelease in the monitoring namespace.

Components

Component Purpose
Prometheus Scrapes and stores metrics from all cluster components
Grafana Dashboards and visualization
kube-state-metrics Exposes K8s object metrics (pod status, deployment replicas, etc.)
node-exporter Exposes node-level metrics (CPU, memory, disk, network)
prometheus-operator Manages Prometheus config via CRDs (ServiceMonitor, PodMonitor)

Access Grafana

minikube service kube-prometheus-stack-grafana -n monitoring
Minikube opens a tunnel and launches the browser automatically.

echo "127.0.0.1  grafana.local" | sudo tee -a /etc/hosts
# Open: http://grafana.local  (requires sudo minikube tunnel)

Login: admin / admin

Change the password

The default password is committed as plaintext for local dev only. Phase 4 will replace this with SOPS-encrypted secrets.

Pre-installed Dashboards

The stack ships with dashboards for:

  • Kubernetes cluster overview
  • Node resource usage (CPU, RAM, disk)
  • Pod and container metrics
  • Namespace resource quotas

Access them via Dashboards → Browse in Grafana.

Adding Your Own Metrics (Phase 3+)

Apps expose metrics at /metrics (Prometheus format). To auto-discover them, create a ServiceMonitor:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: my-app
  namespace: monitoring
spec:
  selector:
    matchLabels:
      app: my-app
  endpoints:
    - port: http
      path: /metrics
      interval: 30s

Prometheus will start scraping automatically — no config file edits needed.

Resource Tuning

Current limits (optimised for MacBook):

Component Memory Request Memory Limit
Prometheus 256 Mi 1 Gi
Grafana 128 Mi 256 Mi
prometheus-operator 64 Mi 128 Mi
kube-state-metrics 32 Mi 64 Mi
node-exporter 32 Mi 64 Mi

Retention: 24h / 2 GB (local sandbox — data does not persist across minikube delete).

See ADR-007 for the full decision record.