Comments (9)
I was planning on asking the Grafana team directly, but it looks like you were quicker. I've labeled this as upstream issue and we can reopen the issue once this gets implemented in Grafana
from grafana-operator.
Hey, @boris-smidt-klarrio
But this means that after the next sync the changes are gone.
I'm not sure how to respond to this, isn't this the intended behaviour? Imho, that's exactly how the operator should behave, the Dashboard CR is the declared state of the dashboard that the operator intends to maintain. User changes should not be saved because they aren't the source of truth.
Your UI-based changes should only live as long as the remaining time to the next periodic reconcile. It's expected that UI changes will not be persisted after the dashboard controller re-syncs the dashboards across all instances.
The Operator only has knowledge of changes on the Grafana API when it reaches its next reconcile, it doesn't actively react to changes on the API in real-time.
My recommendation here would be to decrease the reconcile period for the dashboards you want to be "always true". So they get updated more frequently. Other than that, RBAC based permissions on the Grafana instance would be the way to go, albeit we don't support that yet through the Operator (at least not as a separate CR)
from grafana-operator.
@HubertStefanski i think we have a misunderstanding here. I indeed want the dashboards to be overwritten with the CRD.
But when i use a provider, like the sidecar which scrapes configmaps i can enable the flag allowUiUpdates: false
In that case when you want to save a dashboard you will get the following message:
But when i use a dashboard CRD it will just allow you to save the dashboard.
So it seems the grafana-operator doesn't mark the dashboards as 'provisioned'
from grafana-operator.
@boris-smidt-klarrio thanks for clarifying, I wasn't aware that this was a Grafana setting, In that case I think it makes sense to extend the GrafanaDashboard CRD Spec to accommodate this 👍
from grafana-operator.
https://github.com/grafana/grafana/blob/f11b10a10cefcb12e6825f6ed9a20cf77d8dcc39/pkg/api/dtos/dashboard.go#L34-L35
Good news it seems the dashboard metadata.Provisioned needs to be set.
It might even be best to add it as a default true.
from grafana-operator.
The bad news is that this isn't exposed over the client library used in this project
https://github.com/grafana/grafana-openapi-client-go/blob/main/models/dashboard_meta.go
But it is in the new project which isn't released yet (except latest)
from grafana-operator.
While working on #1462 I took a closer look at how to implement this, and it turns out that the provisioned field can only be set when using file based provisioning on the Grafana side. This means that we cannot set this field via a CR (at least not with how the operator currently works)
As an alternative, you can set the editable
property of the dashboard spec to false. This will at least warn the user before editing the dashboards using the UI
from grafana-operator.
@theSuess So if you set the Provisioned flag in the call to create a dashboard what would happen?
Instead of closing the ticket wouldn't it be better to create a feature request upstream to allow to set the provisioning in the API call?
from grafana-operator.
Oke i'll try to assist as much as i can 👍 Thank you for investigating the provisioned feature a bit deeper.
from grafana-operator.
Related Issues (20)
- [Bug] Unable to set custom secrets without defining grafana container image HOT 6
- watch namespaces using a label selector
- [Bug] Unable to upgrade from v5.6.0 on OpenShift HOT 11
- [doc] Grafana deployment with a Persistent Volume HOT 6
- Unable to limit which Grafana can use which dashboards (v5 operator) HOT 4
- ArgoCD healthcheck and GrafanaDashboard HOT 5
- Apply the default Grafana Version to the CR spec HOT 3
- Pull JSON from GitHub into Grafana for persistent existance of a dashboard HOT 6
- Add status conditions to all objects HOT 2
- Report error when using alerting on older Grafana versions
- Add support for Notification Policies
- Add support for Contact Points HOT 4
- [Bug] 5.7.0 auto upgrade image-pull-backoff HOT 2
- [Bug] External grafana instance with operator gives Invalid username or password HOT 4
- Consolidating Multiple OpenShift Grafana Dashboards Under One URL HOT 5
- [Bug] Missing CRD - GrafanaAlertRuleGroups causes operator to fail to start HOT 9
- Alert rule group failed to be applied - context deadline exceeded HOT 2
- [Bug] Loading dashboards from GrafanaDashboard - "context deadline exceeded" HOT 4
- Add grafana service account feature to Grafana controller HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grafana-operator.