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:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user