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

Customizable config #28

Merged
merged 3 commits into from
Jul 18, 2019
Merged

Conversation

pb82
Copy link
Collaborator

@pb82 pb82 commented Jul 18, 2019

More flexible configuration of Grafana. This allows users to pass all properties into the generated grafana.ini that are supported in the official documentation.

The Grafana CR supports a new field, spec.config. This is a nested structure that will be serialized into the actual ini file. The names of the sections and keys are exactly the same as described in the Grafana documentation.

Relevant issue: #13 (all the configuration required for this use case should now be supported)

Other changes in this PR:

Caveats:

Verification steps:

  1. Deploy the operator from this branch
  2. Make sure to apply the latest CRDs
  3. Create Grafana and make sure it succeeds
  4. Compare the config in the CR with the generated configmap grafana-config
  5. Make a change to the config field in the CR, it should be reflected in the configmap and Grafana should be restarted.
  6. Create a data source and make sure the isDefault option is set to true (you can use the example one).
  7. Log into Grafana and check the datasource: it should be the default one.

@david-martin david-martin self-assigned this Jul 18, 2019
Copy link
Contributor

@david-martin david-martin left a comment

Choose a reason for hiding this comment

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

Config in the Grafana CR was dumped into the grafana-config configmap as expected.

After modifying config in the CR, the configmap got updated immediately, and Grafana restarted, with this log msg in operator logs.
Config was applied OK.

{"level":"info","ts":1563461473.3322098,"logger":"controller_grafana","caller":"grafana/grafana_controller.go:146","msg":"grafana restarted due to config change"}

I created the example Prometheus datasource with the default flag set to true, and it shows up as expected with a default label.
image

@david-martin david-martin merged commit 7e7ec7f into grafana:master Jul 18, 2019
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.

Grafana provisioning configuration is not generated correctly
2 participants