Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/grafana] Support Provisioner Configuration #3514

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stable/grafana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: grafana
version: 0.8.5
version: 0.8.6
appVersion: 5.0.4
description: The leading tool for querying and visualizing time series and metrics.
home: https://grafana.net
Expand Down
18 changes: 18 additions & 0 deletions stable/grafana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ spec:
resources:
{{ toYaml .Values.server.resources | indent 12 }}
volumeMounts:
{{- if .Values.provisioningDatasourcesFiles }}
- name: provisioning-volume
mountPath: {{ default "/var/lib/grafana/provisioning" .Values.server.provisioningLocalPath }}/datasources
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use the default function. Defaults come from values.yaml anyways which is better. Apply to all your changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured this is common practice in the chart. So, let's leave it for now. Would be cool to get that fixed in a separate PR.

{{- end }}
{{- if .Values.provisioningDashboardsFiles }}
- name: provisioning-dashboards-volume
mountPath: {{ default "/var/lib/grafana/provisioning" .Values.server.provisioningLocalPath }}/dashboards
{{- end }}
- name: config-volume
mountPath: {{ default "/etc/grafana" .Values.server.configLocalPath | quote }}
- name: dashboard-volume
Expand All @@ -114,6 +122,16 @@ spec:
- name: dashboard-volume-configmap
configMap:
name: {{ template "grafana.server.fullname" . }}-dashs
{{- if .Values.provisioningDatasourcesFiles }}
- name: provisioning-volume
configMap:
name: {{ template "grafana.server.fullname" . }}-pdata
{{- end }}
{{- if .Values.provisioningDashboardsFiles }}
- name: provisioning-dashboards-volume
configMap:
name: {{ template "grafana.server.fullname" . }}-pdash
{{- end }}
- name: storage-volume
{{- if .Values.server.persistentVolume.enabled }}
persistentVolumeClaim:
Expand Down
14 changes: 14 additions & 0 deletions stable/grafana/templates/provisioning-dashboards-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.provisioningDashboardsFiles -}}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
component: "{{ .Values.server.name }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
name: {{ template "grafana.server.fullname" . }}-pdash
data:
{{ toYaml .Values.provisioningDashboardsFiles | indent 2 }}
{{- end -}}
14 changes: 14 additions & 0 deletions stable/grafana/templates/provisioning-datasources-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.provisioningDatasourcesFiles -}}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
component: "{{ .Values.server.name }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
name: {{ template "grafana.server.fullname" . }}-pdata
data:
{{ toYaml .Values.provisioningDatasourcesFiles | indent 2 }}
{{- end -}}
17 changes: 17 additions & 0 deletions stable/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ server:
##
# storageLocalPath: /var/lib/grafana/data

## Grafana local provisioning path
## Default: '/var/lib/grafana/provisioning'
##
# provisioningLocalPath: /var/lib/grafana/provisioning

## Grafana Pod termination grace period
## Default: 300s (5m)
##
Expand Down Expand Up @@ -274,6 +279,7 @@ serverConfigFile:
data = /var/lib/grafana/data
logs = /var/log/grafana
plugins = /var/lib/grafana/plugins
provisioning = /var/lib/grafana/provisioning

[server]
;protocol = http
Expand Down Expand Up @@ -473,3 +479,14 @@ dashboardImports:
## Default: post-install,post-upgrade
##
hook: post-install,post-upgrade
# restartPolicy: OnFailure


## Grafana dashboard/datasource provisioner configuration
##
## If you'd like to use the provisioners to pull in dashboards from an external
## source, add the configuration files below.
##
## See: http://docs.grafana.org/administration/provisioning/
provisioningDashboardsFiles: {}
provisioningDatasourcesFiles: {}