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

OpenShift 3.11 Projects with Grafana Operator and related CRs get stuck in "Terminating" state??? #79

Closed
jtudelag opened this issue Nov 27, 2019 · 4 comments

Comments

@jtudelag
Copy link

Hi,

First of all, thanks for this awesome operator, is very useful!!!

I'm seeing this behaviour consistently. I haven't gone into more details,
but when I have the Grafana Operator deployed on a project, along with Grafana, GrafanaDashboards and GrafanDataSources CRs, and I delete the Project, the project gets stuck in "Terminating" state.

I guess it has to be realated with the k8s finalizers and the order in which resources are deleted....

@jtudelag
Copy link
Author

Contunuing with the troubleshooting, I see that Dashboards and DataSources objects both have finalizers, while Grafana does not...and I think the root cause...

kind: GrafanaDataSource
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"integreatly.org/v1alpha1","kind":"GrafanaDataSource","metadata":{"annotations":{},"name":"prometheus-ds","namespace":"jorge-prom"},"spec":{"datasources":[{"access":"proxy","editable":true,"isDefault":true,"jsonData":{"timeInterval":"5s","tlsSkipVerify":true},"name":"Prometheus","type":"prometheus","url":"http://prometheus-operated:9090","version":1}],"name":"prometheus-ds.yaml"}}
  creationTimestamp: 2019-11-22T18:47:41Z
  finalizers:
  - grafana.cleanup
  generation: 1
  name: prometheus-ds
.....
apiVersion: integreatly.org/v1alpha1
kind: GrafanaDashboard
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
  finalizers:
  - grafana.cleanup
  generation: 2
  labels:
    app: grafana
  name: kafka-dashboard
  namespace: puto-grafana
  resourceVersion: "20995558"
  selfLink: /apis/integreatly.org/v1alpha1/namespaces/puto-grafana/grafanadashboards/kafka-dashboard
  uid: 98f12603-10ee-11ea-9a3b-0654d1207a24
spec:
  json: |

@jtudelag
Copy link
Author

Actually If I try to delete a dashboard of a data source, sth like this oc delete grafanadashboard kafka-dashboard , the object is not deleted, I have to delete the finalizer of the object, then the object dissapears... Once all the data sources and dashboards are deleted, the project is finally deleted by OCP ;).

@pb82
Copy link
Collaborator

pb82 commented Nov 27, 2019

@jtudelag Yes, that is a common problem with finalizers: the operator gets deleted before it has a chance to service the finalizers on the other resources. Kubernetes won't delete resources until all finalizers are removed and this propagates upwards so that the namespace can't be deleted because of the stuck resources.

One solution to this are ownerReferences that block the owner deletion. But we decided to get rid of finalizers alltogether. This work is currently ongoing in the development branch: https://github.com/integr8ly/grafana-operator/tree/development

It will be included in the next release (mid next week) along with other improvements.

@pb82
Copy link
Collaborator

pb82 commented Dec 6, 2019

@jtudelag Can you please give the new release (https://github.com/integr8ly/grafana-operator/releases/tag/v3.0.0) a try? It does no longer use finalizers and should solve your problem. It should soon also be available on Operatorhub.

@pb82 pb82 closed this as completed Dec 6, 2019
NissesSenap added a commit to NissesSenap/grafana-operator that referenced this issue Mar 14, 2023
* Initial docsy hugo setup
- Add contribution instructions for hugo.
- Adapt docs to work with hugo
- Setup docsy hugo page
- Create CI/CD solution to deploy homepage
* Update blogs to support hugo
* Add helm installation path
* Add crd api docs
* Move documentation away from README in to hugo.
* Add examples to hugo
NissesSenap added a commit that referenced this issue Mar 14, 2023
* Initial docsy hugo setup
- Add contribution instructions for hugo.
- Adapt docs to work with hugo
- Setup docsy hugo page
- Create CI/CD solution to deploy homepage
* Update blogs to support hugo
* Add helm installation path
* Add crd api docs
* Move documentation away from README in to hugo.
* Add examples to hugo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants