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

[Bug] GrafanaDataSource in same namespace as operator not found when WATCH_NAMESPACE="" #303

Closed
jsanda opened this issue Nov 18, 2020 · 6 comments
Labels
bug/major Bug with a major severity, occurs often and affects functionality intermitently bug Something isn't working triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@jsanda
Copy link

jsanda commented Nov 18, 2020

Describe the bug
grafana-operator can manage Grafana and GrafanaDashboard instances across multiple namespaces. This doc mentions that that there is multi-namespace support for GrafanaDataSource. A GrafanaDataSource has to be deployed in the same namespace as the operator.

If you configure the operator to watch multiple namespaces with WATCH_NAMESPACE="", the operator may still fail to discover a GrafanaDataSource created in the same namespace as the operator.

To Reproduce
Steps to reproduce the behavior:

  1. Configure and deploy the operator with cluster-scoped permissions and with WATCH_NAMESPACE="".
  2. Wait for the operator to become ready.
  3. Deploy Grafana and GrafanaDataSource objects in same namepsace as the operator.
  4. Wait for Grafana to become ready.
  5. Log into Grafana. The data source is not listed.

Expected behavior
The operator should find the GrafanaDataSource and register it in the Grafana instance.

Suspect component/Location where the bug might be occuring
I need to review the code more, but I think the issue is here in datasource_controller.go.

Runtime (please complete the following information):

  • Grafana Operator Version: v3.6.0
  • Environment: Kind / GKE, Kubernetes 1.17, 1.18
  • Deployment type: deployed

Additional context
I encountered this issue in the k8ssandra project I work on. It has Helm charts that can be used to easily reproduce the issue. I would be happy to provide steps if that would help.

@jsanda jsanda added bug Something isn't working needs triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 18, 2020
@HVBE HVBE added bug/major Bug with a major severity, occurs often and affects functionality intermitently and removed needs triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 23, 2020
@david-martin
Copy link
Contributor

@jsanda Can you check if specifying the --scan-all flag is sufficient for your use case?
See https://github.com/integr8ly/grafana-operator/blob/master/documentation/multi_namespace_support.md#support-for-multiple-namespaces for more info on what it does.

It looks like setting the env var WATCH_NAMESPACE="" seems to cause unexpected behaviour, so would need to be investigated.
What way are you installing the operator and subsequently setting that var? Is it via helm?

@david-martin david-martin added the triage/needs-information Indicates an issue needs more information in order to work on it. label Feb 23, 2021
@pb82 pb82 removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Apr 6, 2021
@pb82
Copy link
Collaborator

pb82 commented Apr 6, 2021

We're going to document this behavior better for now. In the future we might support multi namespace support for data sources.

@pb82
Copy link
Collaborator

pb82 commented Jul 13, 2021

@jsanda does this work for you when you set the --scan-all operator flag?

@pb82
Copy link
Collaborator

pb82 commented Sep 28, 2021

@jsanda have you had a chance to try it with the --scan-all flag?

@pb82 pb82 added the triage/needs-information Indicates an issue needs more information in order to work on it. label Sep 28, 2021
@jsanda
Copy link
Author

jsanda commented Oct 6, 2021

Hey @pb82

Sorry for the late reply on this. I have not tested as we aren't using grafana-operator any more. Thanks for pinging me though!

@HVBE
Copy link
Collaborator

HVBE commented Oct 6, 2021

Thanks for the response, and sorry to see you've decided to move away from the grafana-operator, was there any specific reason that prompted you to switch to something else?

@HVBE HVBE closed this as completed Oct 6, 2021
Grafana Operator (Kanban) automation moved this from To do to Done Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/major Bug with a major severity, occurs often and affects functionality intermitently bug Something isn't working triage/needs-information Indicates an issue needs more information in order to work on it.
Development

No branches or pull requests

4 participants