Datasource Plugins
This won’t work on external grafana instances. As the operator does not manage the instance itself and thus we can’t set the environment variable that we use to make grafana install plugins for us.
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
name: example-grafanadatasource
spec:
datasource:
access: proxy
type: prometheus
jsonData:
timeInterval: 5s
tlsSkipVerify: true
name: Prometheus
url: http://prometheus-service:9090
instanceSelector:
matchLabels:
dashboards: grafana
plugins:
- name: grafana-clock-panel
version: 1.3.0 # It can also be set to "latest"
Note
A plugin doesn’t have to be pinned to a specific version. If it’s set tolatest
instead, Grafana will install the latest available version upon start. Please, keep in mind that the grafana-operator doesn’t track new plugin releases, so it’s up to an administrator to make sure Grafana pods are occasionally recreated (in most setups, it happens naturally due to dynamic nature of Kubernetes workloads).