From 985fcf71e01fd5d3dfcb19b821852ec498c834c3 Mon Sep 17 00:00:00 2001 From: Yannis Koutras Date: Wed, 20 Mar 2019 09:24:24 +0100 Subject: [PATCH] [stable/grafana] Enable extra init containers and extra emptyDir mounts (#12343) * [stable/grafana] add extraInitContainers Signed-off-by: Ioannis Koutras * [stable/grafana] add extraEmptyDirMounts Signed-off-by: Ioannis Koutras --- stable/grafana/Chart.yaml | 2 +- stable/grafana/README.md | 2 ++ stable/grafana/templates/deployment.yaml | 13 ++++++++++++- stable/grafana/values.yaml | 7 +++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/stable/grafana/Chart.yaml b/stable/grafana/Chart.yaml index bf92a3b0cb..476e9749c7 100755 --- a/stable/grafana/Chart.yaml +++ b/stable/grafana/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: grafana -version: 2.3.1 +version: 2.3.3 appVersion: 6.0.2 kubeVersion: "^1.8.0-0" description: The leading tool for querying and visualizing time series and metrics. diff --git a/stable/grafana/README.md b/stable/grafana/README.md index 33fe532920..44a3060126 100644 --- a/stable/grafana/README.md +++ b/stable/grafana/README.md @@ -54,6 +54,7 @@ The command removes all the Kubernetes components associated with the chart and | `nodeSelector` | Node labels for pod assignment | `{}` | | `tolerations` | Toleration labels for pod assignment | `[]` | | `affinity` | Affinity settings for pod assignment | `{}` | +| `extraInitContainers` | Init containers to add to the grafana pod | `{}` | | `extraContainers` | Sidecar containers to add to the grafana pod | `{}` | | `persistence.enabled` | Use persistent volume to store data | `false` | | `persistence.initChownData` | Change ownership of persistent volume on initialization | `true` | @@ -68,6 +69,7 @@ The command removes all the Kubernetes components associated with the chart and | `extraSecretMounts` | Additional grafana server secret mounts | `[]` | | `extraVolumeMounts` | Additional grafana server volume mounts | `[]` | | `extraConfigmapMounts` | Additional grafana server configMap volume mounts | `[]` | +| `extraEmptyDirMounts` | Additional grafana server emptyDir volume mounts | `[]` | | `plugins` | Plugins to be loaded along with Grafana | `[]` | | `datasources` | Configure grafana datasources (passed through tpl) | `{}` | | `notifiers` | Configure grafana notifiers | `{}` | diff --git a/stable/grafana/templates/deployment.yaml b/stable/grafana/templates/deployment.yaml index f415c43c9c..05225e403b 100644 --- a/stable/grafana/templates/deployment.yaml +++ b/stable/grafana/templates/deployment.yaml @@ -43,7 +43,7 @@ spec: {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} {{- end }} -{{- if ( or .Values.persistence.enabled .Values.dashboards .Values.sidecar.datasources.enabled) }} +{{- if ( or .Values.persistence.enabled .Values.dashboards .Values.sidecar.datasources.enabled .Values.extraInitContainers) }} initContainers: {{- end }} {{- if ( and .Values.persistence.enabled .Values.persistence.initChownData ) }} @@ -101,6 +101,9 @@ spec: - name: sc-datasources-volume mountPath: "/etc/grafana/provisioning/datasources" {{- end}} +{{- if .Values.extraInitContainers }} +{{ toYaml .Values.extraInitContainers | indent 8 }} +{{- end }} {{- if .Values.image.pullSecrets }} imagePullSecrets: {{- range .Values.image.pullSecrets }} @@ -209,6 +212,10 @@ spec: subPath: {{ .subPath | default "" }} readOnly: {{ .readOnly }} {{- end }} + {{- range .Values.extraEmptyDirMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- end }} ports: - name: service containerPort: {{ .Values.service.port }} @@ -345,3 +352,7 @@ spec: persistentVolumeClaim: claimName: {{ .existingClaim }} {{- end }} + {{- range .Values.extraEmptyDirMounts }} + - name: {{ .name }} + emptyDir: {} + {{- end }} diff --git a/stable/grafana/values.yaml b/stable/grafana/values.yaml index 73ff67c54d..d92600b531 100644 --- a/stable/grafana/values.yaml +++ b/stable/grafana/values.yaml @@ -48,6 +48,11 @@ extraConfigmapMounts: [] # readOnly: true +extraEmptyDirMounts: [] + # - name: provisioning-notifiers + # mountPath: /etc/grafana/provisioning/notifiers + + ## Assign a PriorityClassName to pods if set # priorityClassName: @@ -116,6 +121,8 @@ tolerations: [] ## affinity: {} +extraInitContainers: [] + ## Enable an Specify container in extraContainers. This is meant to allow adding an authentication proxy to a grafana pod extraContainers: | # - name: proxy