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

[GrafanaDashboard] operator fails to create a dashboard with hardcoded id #1108

Closed
anushanagireddy0430 opened this issue Jun 15, 2023 · 5 comments · Fixed by #1111
Closed
Assignees
Labels
enhancement New feature or request triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@anushanagireddy0430
Copy link

anushanagireddy0430 commented Jun 15, 2023

Unable to see dashboard created using GrafanaDashbord CR in grafana UI.

operator v5.0.0, grafana 9.5.2

Steps to reproduce the behavior:

  1. Install v5 operator in namespace1 as cluster based operator to watch all namespaces
  2. Deploy grafana in namespace2
  3. Deploy grafanadashboard CR in namespace2 with gZipJson method
  4. View for operator logs, Dashboard not found error is coming, but folder got created in Grafana.

Grafana dashboard should be visible

@anushanagireddy0430 anushanagireddy0430 added bug Something isn't working needs triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 15, 2023
@weisdd
Copy link
Collaborator

weisdd commented Jun 15, 2023

@anushanagireddy0430 please, don't forget to revoke client secret (it's exposed in one of your files).

@weisdd
Copy link
Collaborator

weisdd commented Jun 15, 2023

@anushanagireddy0430 as for the dashboard not being added, your json contains "id": 13, whereas it should have been set to "id": null,, so when the operator tries to create or overwrite the dashboard in Grafana, Grafana simply says that it has no idea what the dashboard with id 13 is, operator just prints that response in logs. So, strictly speaking, you have incorrect json. Though, we can consider nullifying id on the fly.

@pb82 @HubertStefanski @NissesSenap WDYT?

@anushanagireddy0430
Copy link
Author

Thanks @weisdd
It worked after correcting Json.
Didnt think of Checking Json data as same json worked with different grafana instances even though id is not kept null in v4 versions of grafana.

@weisdd weisdd changed the title Dashboard not found in grafana UI [GrafanaDashboard] operator fails to create a dashboard with hardcoded id Jun 18, 2023
@weisdd weisdd removed the needs triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 18, 2023
@weisdd weisdd self-assigned this Jun 18, 2023
@weisdd weisdd added triage/accepted Indicates an issue or PR is ready to be actively worked on. enhancement New feature or request and removed bug Something isn't working labels Jun 18, 2023
@anushanagireddy0430
Copy link
Author

anushanagireddy0430 commented Jul 4, 2023

Hi @weisdd @NissesSenap

I have observed that I am able to see dashboard created using CRD in Grafana UI only when it was deployed to namespace where Grafana is deployed.
Right now I have deployed cluster scoped operator in one namespace and Grafana in separate namespace.
I am unable to find what's wrong with configuration.
`apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
meta.helm.sh/release-name: ecs-central-grafana-operator
meta.helm.sh/release-namespace: ecs-operators
creationTimestamp: "2023-06-22T07:27:31Z"
generation: 1
labels:
app.kubernetes.io/instance: ecs-central-grafana-operator
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: ecs-central-grafana-operator
app.kubernetes.io/version: v5.0.1
filebeat-logs: enabled
helm.sh/chart: ecs-grafana-operator-helmcharts-5.0.1
name: ecs-central-grafana-operator
namespace: ecs-operators
resourceVersion: "12630207"
uid: acbc0b7f-c4f4-4d95-87bf-15c467ea02ab
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/instance: ecs-central-grafana-operator
app.kubernetes.io/name: ecs-central-grafana-operator
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/instance: ecs-central-grafana-operator
app.kubernetes.io/name: ecs-central-grafana-operator
spec:
containers:
- args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=0.0.0.0:9090
env:
- name: WATCH_NAMESPACE
image: xxxxxxxxxxxxxxxx.xxxxxxxxxx/eccs-grafana-operator-dockerimages:grafana-operator_5.0.1_6.0.0
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 8081
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
name: ecs-grafana-operator-helmcharts
ports:
- containerPort: 9090
name: metrics
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /readyz
port: 8081
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 250m
memory: 400Mi
requests:
cpu: 200m
memory: 300Mi
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: docker-secret
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: ecs-central-grafana-operator
serviceAccountName: ecs-central-grafana-operator
terminationGracePeriodSeconds: 30
status:
availableReplicas: 1
conditions:

  • lastTransitionTime: "2023-06-22T07:31:30Z"
    lastUpdateTime: "2023-06-22T07:31:30Z"
    message: Deployment has minimum availability.
    reason: MinimumReplicasAvailable
    status: "True"
    type: Available
  • lastTransitionTime: "2023-06-22T07:27:31Z"
    lastUpdateTime: "2023-06-22T07:31:30Z"
    message: ReplicaSet "ecs-central-grafana-operator-b475497d" has successfully progressed.
    reason: NewReplicaSetAvailable
    status: "True"
    type: Progressing
    observedGeneration: 1
    readyReplicas: 1
    replicas: 1
    updatedReplicas: 1`

Help me understand!

@NissesSenap
Copy link
Collaborator

@anushanagireddy0430 it's unreadable the way you have posted your issue.
I would reach out in our slack channel or create a new issue, please keep posting in closed cases to a minimum.
When you do, make sure that your yaml looks okay and provide the grafana and grafanadashboard CR, not the deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants