From 43879b5217c29ef6f5764f1f245e4141ab6ccb4e Mon Sep 17 00:00:00 2001
From: Arthur Silva Sens <arthursens2005@gmail.com>
Date: Mon, 7 Feb 2022 20:20:20 +0000
Subject: [PATCH] Add extra-volume mount for plugins downloads

Signed-off-by: GitHub <noreply@github.com>
---
 jsonnet/kube-prometheus/components/grafana.libsonnet | 9 +++++++++
 manifests/grafana-deployment.yaml                    | 5 +++++
 2 files changed, 14 insertions(+)

diff --git a/jsonnet/kube-prometheus/components/grafana.libsonnet b/jsonnet/kube-prometheus/components/grafana.libsonnet
index a89e170e..beca7a0c 100644
--- a/jsonnet/kube-prometheus/components/grafana.libsonnet
+++ b/jsonnet/kube-prometheus/components/grafana.libsonnet
@@ -100,7 +100,16 @@ function(params)
                 readOnlyRootFilesystem: true,
                 capabilities: { drop: ['ALL'] },
               },
+              volumeMounts+: [{
+                mountPath: '/tmp',
+                name: 'tmp-plugins',
+                readOnly: false,
+              }],
             }, super.containers),
+            volumes+: [{
+              name: 'tmp-plugins',
+              emptyDir: {},
+            }],
           },
         },
       },
diff --git a/manifests/grafana-deployment.yaml b/manifests/grafana-deployment.yaml
index 69eb37a6..7e185a03 100644
--- a/manifests/grafana-deployment.yaml
+++ b/manifests/grafana-deployment.yaml
@@ -137,6 +137,9 @@ spec:
         - mountPath: /etc/grafana
           name: grafana-config
           readOnly: false
+        - mountPath: /tmp
+          name: tmp-plugins
+          readOnly: false
       nodeSelector:
         kubernetes.io/os: linux
       securityContext:
@@ -228,3 +231,5 @@ spec:
       - name: grafana-config
         secret:
           secretName: grafana-config
+      - emptyDir: {}
+        name: tmp-plugins
-- 
GitLab