Skip to content

Commit 60f381f

Browse files
committed
chore(grafana): add store data in pg
1 parent 9b94fd4 commit 60f381f

4 files changed

Lines changed: 26 additions & 4 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "common.names.fullname" . }}-ini
5+
namespace: {{ .Release.Namespace | quote }}
6+
labels: {{- include "common.labels.standard" . | nindent 4 }}
7+
{{- if .Values.commonLabels }}
8+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
9+
{{- end }}
10+
app.kubernetes.io/component: grafana
11+
{{- if .Values.commonAnnotations }}
12+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
13+
{{- end }}
14+
data:
15+
grafana.ini: |
16+
[database]
17+
type = postgres
18+
url = {{ .Values.pg_url | quote }}

addons/grafana/10/chart/grafana/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ spec:
321321
- name: grafana-ini
322322
{{- if .Values.config.grafanaIniConfigMap }}
323323
configMap:
324-
name: {{ .Values.config.grafanaIniConfigMap }}
324+
name: {{ include "common.names.fullname" . }}-ini
325325
{{- else if .Values.config.grafanaIniSecret }}
326326
secret:
327327
secretName: {{ .Values.config.grafanaIniSecret }}

addons/grafana/10/chart/grafana/values.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,15 @@ ldap:
209209
## @param config.grafanaIniSecret Name of the Secret containing the `grafana.ini` file
210210
##
211211
config:
212-
useGrafanaIniFile: false
213-
grafanaIniConfigMap: ""
212+
useGrafanaIniFile: true
213+
grafanaIniConfigMap: "grafana-ini"
214214
grafanaIniSecret: ""
215215
## Create dasboard provider to load dashboards, a default one is created to load dashboards
216216
## from "/opt/drycc/grafana/dashboards"
217217
## @param dashboardsProvider.enabled Enable the use of a Grafana dashboard provider
218218
## @param dashboardsProvider.configMapName Name of a ConfigMap containing a custom dashboard provider
219219
##
220+
pg_url: "postgres://user:secret@host:port/database"
220221
dashboardsProvider:
221222
enabled: false
222223
## Important to set the Path to "/opt/drycc/grafana/dashboards"
@@ -542,7 +543,7 @@ grafana:
542543
## @param persistence.size Size for the PV
543544
##
544545
persistence:
545-
enabled: true
546+
enabled: false
546547
## If defined, storageClassName: <storageClass>
547548
## If set to "-", storageClassName: "", which disables dynamic provisioning
548549
## If undefined (the default) or set to null, no storageClassName spec is

addons/grafana/10/meta.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ allow_parameters:
2323
description: "service type config for values.yaml"
2424
- name: "grafana.nodeSelector"
2525
required: false
26+
- name: "pg_url"
27+
required: true
28+
description: "Postgres URL for Grafana to connect to"
2629
archive: false

0 commit comments

Comments
 (0)