Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins #6

Merged
merged 5 commits into from
Apr 23, 2019
Merged

Plugins #6

merged 5 commits into from
Apr 23, 2019

Conversation

pb82
Copy link
Collaborator

@pb82 pb82 commented Mar 11, 2019

Allow grafana dashboard CRs to define plugins that the operator then installs by updating the deployment and triggering an init container (https://github.com/integr8ly/grafana_plugins_init).

Plugin installation policy:

  • If a plugin is required only in one dashboard it will be installed in the required version.
  • If a plugin is required only in one dashboard it can be up/downgraded by editing that version
  • If the same plugin is required multiple times (either in the same or different dashboards) the newest version will be picked.
  • If a dashboard requires a more recent version of a plugin, but an older one is already installed, the newer one will not be installed to avoid breaking an existing dashboard (@david-martin does that make sense to you or would you rather upgrade in that case too?)

Verification steps:

  1. Run the operator from this branch either locally or by building an image and installing it to a cluster.
  2. You can deploy it to an integreatly monitoring stack or run the operator standalone
  3. Deploy Grafana: oc create -f deploy/examples/Grafana.yaml
  4. Deploy the Dashboard: oc create -f deploy/examples/GrafahaDashboard.yaml
  5. The Operator resyncs every 10 seconds, so it could take a bit until the plugins are picked up. But once they are a new deployment of the Grafana Pod should be triggered.
  6. Once the pod is running again open Grafana and make sure that you can see two plugins listed as installed in the side panel: grafana-piechart-panel and grafana-clock-panel
  7. Edit the GrafahaDashboard resource.
  8. In Status you should see two messages informing you of the newly installed plugins.
  9. Now remove one of the plugins frmo Spec.plugins and wait for the pod to be restarted.
  10. Check Grafana to make sure only one plugin is now installed.
  11. Now delete the whole GrafanaDashboard resource and wait for the pod to restart.
  12. Make sure that no plugins are installed anymore.
  13. Modify the dashboard yaml file and add a second grafana-piechart-panel, but in version 1.3.5.
  14. Create this dashboard.
  15. Make sure that the more recent version gets installed.
  16. Create a second dashboard that also requires grafana-piechart-panel@1.3.5. Wait for the operator to reconcile (few seconds)
  17. Make sure that there is a message in this dashboard's status informing you that 1.3.5 was not installed, because 1.3.6 is already present.
  18. Delete the second dashboard.
  19. Edit the remaining dashboard and change the version of the piechart plugin to 1.3.5.
  20. Wait for the pod to restart and check Grafana to make sure that now 1.3.5 is installed.

@pb82 pb82 requested a review from david-martin March 11, 2019 09:20
@david-martin david-martin self-assigned this Mar 27, 2019
@pb82 pb82 requested a review from davidkirwan April 17, 2019 10:04
@pb82 pb82 changed the title [WIP] Plugins Plugins Apr 17, 2019
Copy link
Contributor

@davidkirwan davidkirwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pb82 looks good.

@pb82 pb82 merged commit 47a0985 into grafana:master Apr 23, 2019
@pb82 pb82 deleted the plugins branch April 23, 2019 08:27
@david-martin david-martin mentioned this pull request Apr 30, 2019
9 tasks
kd7lxl referenced this pull request in kd7lxl/grafana-operator Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants