How to install custom plugin for Grafana running in Kubernetes cluster on Azure How to install custom plugin for Grafana running in Kubernetes cluster on Azure kubernetes kubernetes

How to install custom plugin for Grafana running in Kubernetes cluster on Azure


You can use an initContainer like this:

initContainers:  - name: local-plugins-downloader    image: busybox    command:      - /bin/sh      - -c      - |        #!/bin/sh        set -euo pipefail        mkdir -p /var/lib/grafana/plugins        cd /var/lib/grafana/plugins        for url in http://192.168.95.169/grafana-piechart-panel.zip; do          wget --no-check-certificate $url -O temp.zip          unzip temp.zip          rm temp.zip        done    volumeMounts:      - name: storage        mountPath: /var/lib/grafana

You need to have an emptyDir volume called storage in the pod, this is the default if you use the helm chart.Then it needs to be mounted on the grafana's container. You also need to make sure that the grafana plugin directory is /var/lib/grafana/plugins