Repository navigation
feat: Grafana image with bundled plugins only - #99
Merged
Merged
Conversation
At every startup Grafana downloads a default set of plugins from grafana.com into its data volume and updates them, replacing the plugins bundled in the image. Plugin versions then drift from the module release and are harder to track for vulnerabilities, and the downloads generate traffic to grafana.com. Disable the preinstall, so only the plugins bundled in the Grafana image are used. On update, remove the plugins Grafana already downloaded, unless the administrator enabled the preinstall again through PODMAN_RUN_OPTS. Apps that are not bundled, like Logs Drilldown, are no longer available. Assisted-by: Claude Code:claude-opus-5.5
A fixed list of preinstalled plugins misses plugins added by future Grafana releases and leaves any other plugin in the data volume. Since Grafana must use only the plugins bundled in its image, remove every plugin found in the volume on update. Also disable plugin installs from the Grafana catalog, so the UI cannot install plugins that the next update would remove. Both settings can be reverted through PODMAN_RUN_OPTS, and then the cleanup is skipped. Assisted-by: Claude Code:claude-sonnet-5.5
gsanchietti
reviewed
Oct 14, 2026
gsanchietti
left a comment
Member
There was a problem hiding this comment.
I do not like it much because sometimes Drilldown (and even Logs) is usefull to explore existing data.
Can u please add them?
With plugin downloads disabled, the Logs Drilldown and Metrics Drilldown apps are no longer installed at runtime. Build a Grafana image that bundles both apps at pinned versions, so they stay available and are updated only with the module. After the build, start Grafana from the image in a temporary container and check that it loads every bundled plugin with a valid signature made by Grafana Labs. The build fails if a plugin is altered, or not compatible with the Grafana version of the image. Renovate updates Grafana and the apps in one pull request, with no manual step. The bundled plugin directories are made read-only, because Grafana deletes a bundled plugin when it installs a newer copy. On update, remove the upstream Grafana image of the previous release. Also pull the Prometheus and Alertmanager images from Docker Hub (docker.io/prom) instead of quay.io. Assisted-by: Claude Code:claude-opus-5.5
DavidePrincipi
force-pushed
the
feat-8210-plugins
branch
from
October 14, 2026 14:50
84eff35 to
40359b8
Compare
gsanchietti
approved these changes
Oct 14, 2026
gsanchietti
left a comment
Member
There was a problem hiding this comment.
Thanks for adding back the plugins.
It's seem a bit too much of work to me, so feel free to remove them and keep only the first commit.
Member
Author
|
I will keep separate commits, so they'll be easy to revert in the future. |
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At every startup Grafana downloads a default set of plugins from
grafana.cominto its data volume and keeps them updated. The downloaded copies replace the plugins bundled in the Grafana image, so plugin versions drift from the module release and are harder to track for vulnerabilities. Behind a DNS (Domain Name System) blocker like Pi-hole, each start also generates about 36 failed lookups forgrafana.com. NethServer/dev#8210With this PR Grafana uses only the plugins shipped with its image, and plugin versions change only with a module release. The module now builds its own Grafana image,
ghcr.io/nethserver/metrics-grafana, which adds the Logs Drilldown and Metrics Drilldown apps to the data sources bundled by Grafana. Other apps (Traces Drilldown, Pyroscope, Advisor) are no longer available, and plugins cannot be installed from the Grafana catalog. Administrators can allow plugin installs again throughPODMAN_RUN_OPTS. Prometheus and Alertmanager are now pulled fromdocker.io/prominstead ofquay.io.grafana/Containerfile: Grafana 13.2.3 plus both apps at pinned versions; bundled plugin directories are read-only, because Grafana deletes a bundled plugin when it installs a newer copybuild-images.shandgrafana/check-plugins.sh: after the build, Grafana runs in a temporary container and must load every bundled plugin with a valid Grafana Labs signature, otherwise the build fails and prints the relevant log lines. This catches altered packages and apps not compatible with the Grafana versiongrafana.serviceandupdate-module.d: runMETRICS_GRAFANA_IMAGEwith plugin preinstall and catalog installs disabled (both overridable); on update, remove every plugin from thegrafana-datavolume and the previous upstream Grafana imagerenovate.json: Renovate updates Grafana and the apps together in one pull request, with no manual stepHow to test
grafana-data/pluginscontains the downloaded plugins, then update to this buildpluginsdirectory is empty and that Grafana runs frommetrics-grafana, with dashboards and data sources workingplugin.backgroundinstallerorgrafana.comlines, and that the oldGRAFANA_IMAGEvariable and image are goneOn a test node, a simulated update (new unit and update steps run by hand, image built locally) passed these checks, and the build-time check passed on the good image and failed on an image with one altered app file. A real update from the registry is still to be done.
See also
Generated by Claude Code:claude-opus-5.5 with nethserver-pr