kube-prometheus/hack/scripts/generate-dashboards-configmap.sh
Frederic Branczyk d9086e9875 kube-prometheus: remove duplication in grafana dashboards
Datasource links were duplicated in the grafana dashboads. This now also
allows exporting grafana dashboards from the UI and just dropping them
into the assets directory and they will be wrapped by the manifest
generation script.
2017-03-13 12:08:30 +01:00

22 lines
346 B
Bash
Executable File

#!/bin/bash
cat <<-EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboards
data:
EOF
for f in assets/grafana/*-dashboard.json
do
echo " $(basename $f): |+"
hack/scripts/wrap-dashboard.sh $f | sed "s/^/ /g"
done
for f in assets/grafana/*-datasource.json
do
echo " $(basename $f): |+"
cat $f | sed "s/^/ /g"
done