From 0631035a43f279e799b3279ef768b68d96dc47f4 Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Mon, 16 Mar 2026 15:43:55 -0700 Subject: [PATCH] Add UnPoller Grafana dashboards via initcontainer Fetches 6 Prometheus dashboards from the forge-mirrored unpoller/dashboards repo at pod startup, matching the TeslaMate dashboard pattern. Co-Authored-By: Claude Opus 4.6 (1M context) --- argocd/manifests/grafana/deployment.yaml | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/argocd/manifests/grafana/deployment.yaml b/argocd/manifests/grafana/deployment.yaml index bdf4a6f..74315d7 100644 --- a/argocd/manifests/grafana/deployment.yaml +++ b/argocd/manifests/grafana/deployment.yaml @@ -90,6 +90,38 @@ spec: volumeMounts: - name: sc-dashboard-volume mountPath: /tmp/dashboards + # Fetch UnPoller (UniFi) dashboards from forge mirror. + # Source: github.com/unpoller/dashboards (v2.0.0 Prometheus set) + - name: init-unpoller-dashboards + image: docker.io/library/alpine:kustomized + imagePullPolicy: IfNotPresent + command: ["sh", "-c"] + args: + - | + set -e + BASE_URL="https://forge.ops.eblu.me/mirrors/unpoller-dashboards/raw/branch/master/v2.0.0" + DEST="/tmp/dashboards/UniFi" + mkdir -p "$DEST" + for f in \ + "UniFi-Poller_ Client DPI - Prometheus.json" \ + "UniFi-Poller_ Client Insights - Prometheus.json" \ + "UniFi-Poller_ Network Sites - Prometheus.json" \ + "UniFi-Poller_ UAP Insights - Prometheus.json" \ + "UniFi-Poller_ USG Insights - Prometheus.json" \ + "UniFi-Poller_ USW Insights - Prometheus.json" \ + ; do + wget -q -O "$DEST/$f" "$BASE_URL/$(echo "$f" | sed 's/ /%20/g')" + done + echo "Fetched $(ls "$DEST" | wc -l) UnPoller dashboards" + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: ["ALL"] + seccompProfile: + type: RuntimeDefault + volumeMounts: + - name: sc-dashboard-volume + mountPath: /tmp/dashboards containers: # Dashboard sidecar - watches ConfigMaps with grafana_dashboard=1 - name: grafana-sc-dashboard