feat(grafana): migrate from SQLite/PVC to PostgreSQL backend

Grafana now stores users, preferences, and state in our existing
PostgreSQL instance (dedicated 'grafana' database). This eliminates
the 2Gi PVC dependency — all persistent state lives in Postgres,
dashboards in ConfigMaps, datasources in Helm values.

Also adds Grafana to Postgres NetworkPolicy ingress allowlist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-02 13:01:11 +01:00
parent c608e62082
commit 216240bcd5
2 changed files with 15 additions and 3 deletions

View File

@@ -21,15 +21,24 @@ resources:
memory: 256Mi
persistence:
enabled: true
size: 2Gi
enabled: false
adminUser: admin
adminPassword: Welcome01
envFromSecrets:
- name: db-credentials
grafana.ini:
server:
root_url: https://grafana.fxhnt.ai
database:
type: postgres
host: postgres:5432
name: grafana
user: foxhunt
password: $__env{password}
ssl_mode: disable
datasources:
datasources.yaml:

View File

@@ -1,4 +1,4 @@
# Postgres: accepts connections from foxhunt app pods + GitLab (Helm release)
# Postgres: accepts connections from foxhunt app pods, GitLab, and Grafana
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
@@ -20,6 +20,9 @@ spec:
- podSelector:
matchLabels:
release: gitlab
- podSelector:
matchLabels:
app.kubernetes.io/name: grafana
ports:
- protocol: TCP
port: 5432