这是indexloc提供的服务,不要输入任何密码
Skip to content

[FEATURE] Wrap Grafana Image to Improve Portability and Kubernetes UX #146

@devsteppe9

Description

@devsteppe9

Is your feature request related to a problem? Please describe.
Yes. Currently, the setup relies on host-mounted volumes for Grafana_Dashboard and Grafana_Datasource provisioning. This works well in Docker Compose setups, but it's inconvenient and error-prone when deploying to Kubernetes. It also requires users to manually adjust the ${DS_GARMIN_STATS} placeholder.

Describe the solution you'd like
I propose wrapping the official Grafana image with a custom Docker image pushing into your registry that:

  • Automatically copies in the provisioning files (datasources and dashboards)
  • Replaces the ${DS_GARMIN_STATS} variable with garmin_influxdb at build time
  • Sets the necessary environment variables inside the image
  • Removes the need to mount local volumes for provisioning

This makes the deployment:

  • More portable (especially for Kubernetes)
  • Easier for users, who no longer need to deal with volume mounts or environment-specific configuration
  • Cleaner, as it removes redundancy from docker-compose.yml

Describe alternatives you've considered

  • Keeping the volume mount approach (status quo): not ideal for Kubernetes users
  • Using ConfigMaps and init containers in Kubernetes to inject these files: more complex for beginners, less user-friendly, and ConfigMap data size limitation

Additional context
I tested this on my local setup with this commit:
🔗 fc72d06 – Custom Grafana Dockerfile

If you like the approach, I'm happy to open a pull request and update the example-compose.yml to use the new custom image instead of the official Grafana image directly.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions