-
Notifications
You must be signed in to change notification settings - Fork 399
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
Cannot create multiple Grafana in the same namespace. #174
Comments
Moreover, it seems that grafana-operator cannot detect Grafana CRs in namespaces except for grafana-operator's namespace. (ref) As a result of them, grafana-operator can deploy single grafana only, is it true? |
Facing issue cause of this, it would be nice if we can support a different namespace for grafana. Its alright(even preferred) to place data sources in same namespace as in grafana. |
@dulltz @rverma-jm There's some planned work involving the ability for Grafana's to be managed by operators from different namespaces coming up soon, Not sure of the timeframe though so I can't give a definite "When". |
@HubertStefanski |
@dulltz Most of this planning for now is done internally as part of the development process for the Integreatly-Operator, as needs arise for functionality we delegate to work on the grafana-operator, we are actively ensuring that we take in a few issues for the grafana-operator in each sprint to keep it moving forward. |
@dulltz @HubertStefanski Yes, currently the development of this operator is mainly discussed via Github issues and in our internal chat rooms. We can consider creating a google group for it. |
@HubertStefanski @pb82
I'm concerned that running a Google Group will be too costly for the core members. |
Any update on this? |
@NissesSenap @dulltz We are working on publishing a roadmap, but it will still take some time. Multi namespace support is considered, but probably not one of the top priorities from our side (although we certainly will accept community pull requests for this). |
I'd like to address this issue. As for running multiple Grafana in the same namespace, I believe that this can be easily solved by not creating resources with fixed names and prefixing them with the e.g.: func GrafanaDeployment(cr *v1alpha1.Grafana, configHash, dsHash string) *v1.Deployment {
return &v1.Deployment{
ObjectMeta: v12.ObjectMeta{
- Name: GrafanaDeploymentName,
+ Name: fmt.Sprintf("%s-%s", cr.Name, GrafanaDeploymentName),
Namespace: cr.Namespace,
},
Spec: getDeploymentSpec(cr, nil, configHash, "", dsHash),
}
} However, there is a problem with the GrafanaDataSource resource. The current logic looks like this (If I’m wrong, please comment):
If you prefix Also, the GrafanaDashboard and GrafanaDataSource resources share the state of the Grafana controller in the
I think grafana-operator is currently used by many companies, so we have to be careful about breaking changes. I consider this to be a difficult and complex issue. dashboardLabelSelectors:
type: array
items:
type: object
description: Label selector or match expressions
+ datasourceLabelSelectors:
+ type: array
+ items:
+ type: object
+ description: Label selector or match expressions GrafanaDashboard and GrafanaDataSource controllers refer to the labelselector of the multiple Grafana objects they hold, determine the match, and execute the process. (This can be may inefficient) Do you have any other good ideas for this? |
We had a conversation in the Kubernetes Slack thread: |
I have created a PoC for architectural changes in grafana-operator to solve this problem: |
@d-kuro thanks a lot! We'd like to evaluate your PR as soon as we can. This seems to address both issues. Would you mind trying a rebase on latest master on your branch? |
Resolved in #919 |
I tried to create multiple Grafana CRs in the same namesapce.
However, the generated resource names are duplicated since they are hard-coded such as
grafana-service
orgrafana-admin-credentials
.As a result of it, I failed to create multiple Grafana CR on the same namesapce.
I think we should support multiple Grafana in the same namespace.
If grafana-operator builds resource names as ${grafana-name}-${resource-name}, this issue would be solved.
The text was updated successfully, but these errors were encountered: