From 9faca17bfd6b13cadd14516e33a0e03924e64cc8 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 9 Jul 2021 09:32:39 +0200 Subject: [PATCH] Reorganize configs - Rename directories like the volumes. - Add Grafana dashboard provisioning, and split off config. It was weird to mount the same directory under two different paths. - Now arbitrary dashboards can be put into grafana-provisioning/dashboards/*.json and they will be automatically deployed. --- {conf-grafana => grafana-config}/grafana.ini | 0 grafana-provisioning/dashboards/all.yml | 5 +++++ .../datasources}/datasource.yaml | 0 learn-metrics.yaml | 13 ++++++------- .../prometheus.yml | 0 5 files changed, 11 insertions(+), 7 deletions(-) rename {conf-grafana => grafana-config}/grafana.ini (100%) create mode 100644 grafana-provisioning/dashboards/all.yml rename {conf-grafana => grafana-provisioning/datasources}/datasource.yaml (100%) rename {conf-prometheus => prometheus-config}/prometheus.yml (100%) diff --git a/conf-grafana/grafana.ini b/grafana-config/grafana.ini similarity index 100% rename from conf-grafana/grafana.ini rename to grafana-config/grafana.ini diff --git a/grafana-provisioning/dashboards/all.yml b/grafana-provisioning/dashboards/all.yml new file mode 100644 index 0000000..3e04b4b --- /dev/null +++ b/grafana-provisioning/dashboards/all.yml @@ -0,0 +1,5 @@ +apiVersion: 1 +providers: + - name: default + options: + path: /etc/grafana/provisioning diff --git a/conf-grafana/datasource.yaml b/grafana-provisioning/datasources/datasource.yaml similarity index 100% rename from conf-grafana/datasource.yaml rename to grafana-provisioning/datasources/datasource.yaml diff --git a/learn-metrics.yaml b/learn-metrics.yaml index 7c1c7ea..3d6c678 100644 --- a/learn-metrics.yaml +++ b/learn-metrics.yaml @@ -21,8 +21,8 @@ spec: - name: grafana-config mountPath: /grafana-config readOnly: true - - name: grafana-datasource - mountPath: /etc/grafana/provisioning/datasources/datasource.yaml + - name: grafana-provisioning + mountPath: /etc/grafana/provisioning readOnly: true - image: quay.io/prometheus/prometheus:latest @@ -45,14 +45,13 @@ spec: volumes: - hostPath: - path: ./conf-grafana/datasource.yaml - type: File - name: grafana-datasource + path: ./grafana-provisioning + name: grafana-provisioning - hostPath: - path: ./conf-grafana + path: ./grafana-config name: grafana-config - hostPath: - path: ./conf-prometheus + path: ./prometheus-config name: prometheus-config - hostPath: path: ./http diff --git a/conf-prometheus/prometheus.yml b/prometheus-config/prometheus.yml similarity index 100% rename from conf-prometheus/prometheus.yml rename to prometheus-config/prometheus.yml -- 2.39.5