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

Support for orgId in GrafanaDashboard #525

Closed
m-yosefpor opened this issue Sep 7, 2021 · 6 comments
Closed

Support for orgId in GrafanaDashboard #525

m-yosefpor opened this issue Sep 7, 2021 · 6 comments

Comments

@m-yosefpor
Copy link

Is your feature request related to a problem? Please describe.

When creating GrafanaDashboard, we should be able to set an orgId field to indicate which organization this dashboard should be in. Right now, only GrafanaDataSource object supports this field.

Additional context
To support multi-tenancy with grafana-operator, right now it is possible to add different datasources for each grafana organization, however, for dashboards it is not possible yet to handle this via operator, and we should manually import/create corresponding dashboards for each organization. Grafana folders support permssion, but as currently data source permissions are enterprise only feature, we can't provide multi-tenany without organizations (solely with folder permissions).

@m-yosefpor m-yosefpor added enhancement New feature or request needs triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 7, 2021
@hubeadmin
Copy link
Collaborator

Hi @m-yosefpor , it looks like #408 is going to address the same issue, I believe @bhiravabhatla has started some work on this, but I'm not sure how far along it is.

This isn't something that is officially supported by the operator through a kubernetes-friendly way, however, you can still make use of non-supported features by deploying the grafana-operator with a HA deployment, which will persist all of your resources in a database (as opposed to k8s), you could make use of the orgId feature in dashboards this way, but you won't be able to define it with a grafanadashboard CR, unless you use raw json.

I think you could also get around this, with your current method, but instead, definining your dashboards through a raw JSON field, like in this example: https://github.com/grafana-operator/grafana-operator/blob/master/deploy/examples/dashboards/SimpleDashboard.yaml

Please let us know how this works out for you and whether this is still an issue after our proposed solutions.

As always, feel free to send in a PR that would implement the feature that you need, and we can review and verify it for you. Thanks!

@hubeadmin hubeadmin added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 14, 2021
@m-yosefpor
Copy link
Author

Hi @HubertStefanski . I think #408 is not the same as this issue, since this issue only concerns about dashboards to be referenced with an orgId (like what currently grafanadatasource CR supports), and does not concern managing orgs .

Regarding raw JSON solution you mentioned, the dashboard json does not include any fields about orgId. But rather the folder should be created via a ?orgId=x query parameter during API call (so dashboard_controller code should be changed accordingly).

Thanks. I will send a PR to add support for this.

@NissesSenap NissesSenap added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Sep 23, 2021
@h-otter
Copy link

h-otter commented Apr 26, 2022

Hello, thanks for this useful software!

Is there any update about this issue? I am also eager for this feature.

Should I send a PR? In that case, would you tell me what I have to do in addition to #533?

@NissesSenap
Copy link
Collaborator

Sorry for not providing any update on this issue.

Our current feeling is that organizations isn't something that should be used inside grafana. We have spoken some with the grafana team about this topic and they agree and that is why organizations isn't supported in there cloud offering.

From our point of view the solution is to use multiple grafana instances. We know that this feature currently isn't supported for the operator and we are currently working hard on version 5 to support multi namespace mutli grafana instances.

It would be rather strange for us to merge this in to version 4 and then not allow it in version 5. Thus we don't plan to add support for this feature in version 4.

Sorry for the bad news.
We hope that you can see our point and that you just like us is looking forward to version 5 of the operator.

@NissesSenap NissesSenap closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2022
@NissesSenap NissesSenap added wontfix and removed enhancement New feature or request triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Oct 18, 2022
@joyartoun
Copy link

This feature would be really nice to have. I understand that maybe organizations "should" not be used, but it is the only way for my organization to have a multi-tenant grafana. We don't want several instances of grafana, only 1, and in that all of the metrics and logs should be available.

I want to be able to create dashboards and share them with other orgs.

Does anyone have a programmatical way of solving this issue without this feature? I would be very interested in that.

@NissesSenap
Copy link
Collaborator

@joyartoun if all you want to do is to share dashboards between your orgs why not use multiple grafana instances + a decent CD/gitops solution?

From my point of view we will never support multiple orgs, the complexity it creates is just to much to maintain and trust me I have tried to come up with a good solution around this.
And I assume this is the same reason why grafana cloud don't support it ether.

But if you still don't think that is enough then please try to come up with a CRD design that would still be easy to use for none org users and decent to maintain and the maintainer team would be happy to review your ideas.
If you want to look at the work I have done you can find it here: #615
Just take version 5 in to consideration, https://github.com/grafana-operator/grafana-operator-experimental, the repo will soon be merged in to this repo and with it a new way of managing the CRD:s.

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 a pull request may close this issue.

5 participants