Unable to set up GrafanaDatasource on OpenShift

Hi all,

I’m having issues setting up Loki and Prometheus datasources on Grafana. Details below:

  • Grafana operator (v5.20.0) installed in an OpenShift 4.16 cluster.
  • Grafana instance created via operator. The instance is functional and I have been able to create a Prometheus datasource via the Grafana UI
  • This Grafana instance has the label “dashboards: grafana
  • Created a GrafanaDatasource resource in the same namespace as the Grafana instance and specified spec.instanceSelector.matchLabels.dashboards: grafana

The GrafanaDatasource is showing the following status:

status:
  NoMatchingInstances: true
  conditions:
    - lastTransitionTime: 
      message: 'None of the available Grafana instances matched the selector, skipping reconciliation'
      observedGeneration: 2
      reason: EmptyAPIReply
      status: 'True'
      type: NoMatchingInstance

This seems to be an issue with version 5.20.0 of the operator. Downgrading to an earlier version fixed it.