diff --git a/kube-prometheus/kustomization.yaml b/kube-prometheus/kustomization.yaml index 95103f0..89df78f 100644 --- a/kube-prometheus/kustomization.yaml +++ b/kube-prometheus/kustomization.yaml @@ -7,6 +7,8 @@ resources: - resources/secret.grafana-admin.yaml - resources/secret.auth.yaml - resources/secret.db.yaml + - resources/db/db.yaml + - resources/db/user.yaml - resources/http_routes.grafana.yaml helmCharts: diff --git a/kube-prometheus/resources/db/db.yaml b/kube-prometheus/resources/db/db.yaml new file mode 100644 index 0000000..3f43d7c --- /dev/null +++ b/kube-prometheus/resources/db/db.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: db.movetokube.com/v1alpha1 +kind: Postgres +metadata: + name: grafana +spec: + database: grafana + dropOnDelete: false \ No newline at end of file diff --git a/kube-prometheus/resources/db/user.yaml b/kube-prometheus/resources/db/user.yaml new file mode 100644 index 0000000..70b1599 --- /dev/null +++ b/kube-prometheus/resources/db/user.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: db.movetokube.com/v1alpha1 +kind: PostgresUser +metadata: + name: grafana +spec: + role: grafana + database: grafana + secretName: db-credentials + privileges: OWNER + secretTemplate: + GF_DB_USER: "{{.Role}}" + GF_DB_PASSWORD: "{{.Password}}" \ No newline at end of file