grafana-operator / grafana_plugins_init

The image for the Grafana init container
Apache License 2.0
1 stars 15 forks source link

Plugin mirror in china #3

Closed yogeek closed 3 years ago

yogeek commented 4 years ago

Hello,

I installed Grafana operator on a K8S cluster in AWS China and then install this dashboard CR to initialize some plugins used in future dashboards :

apiVersion: integreatly.org/v1alpha1
kind: GrafanaDashboard
metadata:
  name: empty-dashboard
  labels:
    app: grafana
    monitoring.discovery.dashboards: "true"
spec:
  json: |
    {
      "id": null,
      "title": "Empty Dashboard",
      "tags": [],
      "style": "dark",
      "timezone": "browser",
      "editable": true,
      "hideControls": false,
      "graphTooltip": 1,
      "panels": [],
      "time": {
        "from": "now-6h",
        "to": "now"
      },
      "timepicker": {
        "time_options": [],
        "refresh_intervals": []
      },
      "templating": {
        "list": []
      },
      "annotations": {
        "list": []
      },
      "refresh": "5s",
      "schemaVersion": 17,
      "version": 0,
      "links": []
    }
  name: empty-dashboard.json
  plugins:
  - name: "grafana-piechart-panel"
    version: "1.5.0"
  - name: "camptocamp-prometheus-alertmanager-datasource"
    version: "0.0.8"
  - name: "grafana-worldmap-panel"
    version: "0.3.2"
  - name: "simpod-json-datasource"
    version: "0.2.0"
  - name: "agenty-flowcharting-panel"
    version: "0.8.1"

But the initialization was so long I thought there was an error with the grafana server... I then checked the different plugins download time from a China server and it appears that it was indeed the cause of the problem : more than 8 minutes to download these 5 plugins. (the main culprit being "agenty-flowcharting-panel" which took 6 min...)

My question is : is there any mirror for grafana plugin I could use in China please ? And is there a way to configure grafana to use another download plugin server in the first place ?

pb82 commented 4 years ago

@yogeek I'm not aware of any mirrors for plugins, but that question may be better suited for Grafana themselves. As for downloading from a different source: at the moment this is not possible, the Grafana registry is hardcoded in the init container: https://github.com/integr8ly/grafana_plugins_init/blob/master/plugins.py#L38

However, we could support this by using an env var and allowing it to be overridden in the Grafana CR.

yogeek commented 4 years ago

@pb82 ok thanks for your help. I am going to raise the question in grafana project then.

NissesSenap commented 3 years ago

Looking at the answer in grafana I think we can close this issue.