diff --git a/lib/prometheus.sh b/lib/prometheus.sh index 1510529..a7a2b9c 100755 --- a/lib/prometheus.sh +++ b/lib/prometheus.sh @@ -117,7 +117,7 @@ _setup_dashboard(){ if [ -f "$DASHBOARD_DIR/grafana-dashboards/kepler-exporter-configmap.yaml" ]; then return 0 else - header "Setup Dashboard" + header "Setup Dashboard base on $DASHBOARD_DIR" mkdir -p "$DASHBOARD_DIR/grafana-dashboards/" cat - > "$DASHBOARD_DIR/grafana-dashboards/kepler-exporter-configmap.yaml" << EOF apiVersion: v1 diff --git a/main.sh b/main.sh index 82beeb8..28eef49 100755 --- a/main.sh +++ b/main.sh @@ -123,6 +123,7 @@ print_config() { Monitoring * Install Prometheus : $prom_install_msg * Install Grafana : $GRAFANA_ENABLE + if Grafana been enabled, the kepler dashboard will be installed. Tekton * Install Tekton : $TEKTON_ENABLE diff --git a/verify.sh b/verify.sh index 4c99b57..4a360b4 100755 --- a/verify.sh +++ b/verify.sh @@ -82,6 +82,9 @@ containerruntime() { run_yq(){ + if [ -f "$DASHBOARD_DIR/grafana-dashboards/kepler-exporter-configmap.yaml" ]; then + return 0 + fi f="$DASHBOARD_DIR/grafana-dashboards/kepler-exporter-configmap.yaml" \ yq -i e '.items += [load(env(f))]' "$KUBE_PROM_DIR"/manifests/grafana-dashboardDefinitions.yaml; yq -i e '.spec.template.spec.containers.0.volumeMounts += [ {"mountPath": "/grafana-dashboard-definitions/0/kepler-exporter", "name": "grafana-dashboard-kepler-exporter", "readOnly": false} ]' "$KUBE_PROM_DIR"/manifests/grafana-deployment.yaml