grafana-operator: error creating dashboard, expected status 200 but got 404

Hi,

i tried to import SimpleDashboard (https://github.com/integr8ly/grafana-operator/blob/master/deploy/examples/dashboards/SimpleDashboard.yaml)

$ kubectl apply -f https://github.com/integr8ly/grafana-operator/blob/master/deploy/examples/dashboards/SimpleDashboard.yaml

$ kubectl get grafanadashboards.integreatly.org -o yaml| grep -A 4 status:
  status:
    hash: ""
    id: 0
    message: error creating dashboard, expected status 200 but got 404
    phase: failing 

$ stern grafana-operator  | grep simple-dashboard                             
+ grafana-operator-5f8cb65798-hb2qp › grafana-operator                                
grafana-operator-5f8cb65798-hb2qp grafana-operator {"level":"info","ts":1581498721.864
8725,"logger":"controller_grafanadashboard","msg":"cannot submit dashboard monitoring/
simple-dashboard"} 

I use OLM to install grafana-operator in Version 3.0.2 in eks (k8s-version: v1.14.7-eks-1861c5) Grafana was installed with auth.generic_oauth

apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
  name: example-grafana
spec:
  deployment:
    replicas: 2
    annotations:
      iam.amazonaws.com/role: k8s-cloudwatch-sts
  ingress:
    enabled: true
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt-prod
      kubernetes.io/ingress.class: nginx
    hostname: grafana.eks.<my-domain>
    tlsEnabled: true
    tlsSecretName: grafana-eks-<my-domain>
  config:
    server:
      root_url: https://grafana.eks.<my-domain>
    log:
      mode: "console"
      level: "debug"
    security:
      admin_user: "<myuser>"
      admin_password: "<mypassword>"
    auth:
      disable_login_form: false
    auth.generic_oauth:
      enabled: true
      client_id: app-grafana
      role_attribute_path: roles[0]
      client_secret: <myclientsecret>
      scopes: openid profile email roles
      auth_url: https://idp.<my-domain>/auth/realms/<myrealm>/protocol/openid-connect/auth
      token_url: https://idp.<my-domain>/auth/realms/<myrealm>/protocol/openid-connect/token
      api_url: https://idp.<my-domain>/auth/realms/<myrealm>/protocol/openid-connect/userinfo
      allowed_domains: <my-domain>
    database:
      type: postgres
      host: grafana-cluster:5432
      name: userdb
      user: <myuser>
      password: <mypassword>
  dashboardLabelSelector:
    - matchExpressions:
        - {key: app, operator: In, values: [grafana]}

something I do wrong?

greetings Andre

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 27 (1 by maintainers)

Most upvoted comments

Not sure if I get a chance to try it out this week, so if you want to give it a try please go ahead

I did a successful test using the following syntax for ingress

if state.GrafanaIngress != nil && !preferService {
		for _, ingress:= range state.GrafanaIngress.Status.LoadBalancer.Ingress {
			if ingress.IP != "" {
				return fmt.Sprintf("http://%v", cr.Spec.Ingress.Hostname), nil
			}