From e643009aa241cabab7c838e8163dcfdf5f491c3f Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Sun, 24 Apr 2022 21:15:15 +0200
Subject: [PATCH] fix(matrix): Fix expoter authentication to postgres database

This patch fixes the not-functional exporter due to absence of usable
credentials.

References:
https://github.com/zalando/postgres-operator/issues/264#issuecomment-873930924
---
 apps/base/matrix/database.yaml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/apps/base/matrix/database.yaml b/apps/base/matrix/database.yaml
index beb8cc97d..d4963c94f 100644
--- a/apps/base/matrix/database.yaml
+++ b/apps/base/matrix/database.yaml
@@ -42,6 +42,15 @@ spec:
         requests:
           cpu: 100m
           memory: 200M
+      env:
+      - name: "DATA_SOURCE_URI"
+        value: "$(POD_NAME)/postgres?sslmode=require"
+      - name: "DATA_SOURCE_USER"
+        value: "$(POSTGRES_USER)"
+      - name: "DATA_SOURCE_PASS"
+        value: "$(POSTGRES_PASSWORD)"
+      - name: "PG_EXPORTER_AUTO_DISCOVER_DATABASES"
+        value "true"
 ---
 apiVersion: monitoring.coreos.com/v1
 kind: PodMonitor
-- 
GitLab