Skip to content

Commit 606ffd5

Browse files
committed
build(grafana-operator): mirror Grafana catalog plugins into the dashboards image
Download the pinned Grafana plugin zips (VictoriaLogs datasource + panels) from the official catalog at image build time and serve them next to the dashboards. Grafana pods can then install plugins from this in-cluster server instead of reaching the public catalog at startup, which keeps air-gapped and egress-restricted installs working. Assisted-By: Claude Signed-off-by: Andrei Kvapil <[email protected]>
1 parent 9c63df7 commit 606ffd5

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

  • packages/system/grafana-operator/images/grafana-dashboards

‎packages/system/grafana-operator/images/grafana-dashboards/Dockerfile‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
1+
FROM alpine:3.24@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b AS plugins
2+
3+
RUN apk add --no-cache curl
4+
5+
# Grafana plugins mirrored from the official catalog
6+
# (https://grafana.com/grafana/plugins) at build time and served next to the
7+
# dashboards, so Grafana pods install them from this in-cluster server instead
8+
# of downloading from the internet at startup — required for air-gapped and
9+
# egress-restricted installs. Keep ids and versions in sync with
10+
# GF_INSTALL_PLUGINS in packages/system/monitoring/templates/grafana/grafana.yaml.
11+
RUN mkdir -p /plugins \
12+
&& for p in \
13+
victoriametrics-logs-datasource:0.29.0 \
14+
natel-discrete-panel:0.1.1 \
15+
grafana-worldmap-panel:1.0.6 \
16+
marcusolsson-dynamictext-panel:6.2.0 \
17+
; do \
18+
id="${p%%:*}"; ver="${p##*:}"; \
19+
curl -fsSL -o "/plugins/${id}-${ver}.zip" \
20+
"https://grafana.com/api/plugins/${id}/versions/${ver}/download" \
21+
|| exit 1; \
22+
done
23+
124
FROM alpine:3.24@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b
225

326
RUN apk add --no-cache darkhttpd
427

528
COPY dashboards /var/www/dashboards
29+
COPY --from=plugins /plugins /var/www/dashboards/plugins
630

731
WORKDIR /var/www
832

0 commit comments

Comments
 (0)