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

Fix csv 4.0 #522

Merged
merged 4 commits into from
Sep 18, 2021
Merged

Fix csv 4.0 #522

merged 4 commits into from
Sep 18, 2021

Conversation

pb82
Copy link
Collaborator

@pb82 pb82 commented Sep 7, 2021

Fixes the issue with certain CR fields being removed after upgrading to v4.0.0

@hubeadmin
Copy link
Collaborator

hey @pb82 can you send on the catalogsource? i'd like to try it out with OLM

@pb82
Copy link
Collaborator Author

pb82 commented Sep 10, 2021

@HubertStefanski the following CatalogSource can be used to verify the changes:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: grafana-operator-manifests
  namespace: grafana
spec:
  sourceType: grpc
  image: quay.io/pb82/grafana-operator-index:v4.0.0

To verify the whole migration:

  1. Install v3.10.3 from OperatorHub
  2. Install Grafana, some dashboards and data sources
  3. Uninstall the Grafana Operator
  4. Install v4.0.0 using this CatalogSource (create the CatalogSource inside the same namespace, after a minute or two you should see a new category in the Operatorhub page in OpenShift).
  5. Verify that all dashboards and datasources are still there and are reconciled.
  6. Verify that all configuration options are still there and managed.

@hubeadmin
Copy link
Collaborator

@pb82 I'm still unsuccessful in getting it to work, the OLM deployment hangs on pending waiting for requirementsNotMet, the operator pod also doesn't spin up, let's sync the next day and try and figure this out, not sure why this is happening when yours works, perhaps it could be something specific to what my ROSA cluster is running

@hubeadmin
Copy link
Collaborator

hubeadmin commented Sep 13, 2021

Adding some more context, looks like some auth resources are missing, trying to figure out why. Adding them manually through the CLI doesn't seem to do the trick anymore 🤔

 message: one or more requirements couldn't be found
  phase: Pending
  reason: RequirementsNotMet
  requirementStatus:
    - group: apiextensions.k8s.io
      kind: CustomResourceDefinition
      message: CRD is present and Established condition is true
      name: grafanadashboards.integreatly.org
      status: Present
      uuid: 2e1ed639-faf0-472b-b828-8695fd634bef
      version: v1
    - group: apiextensions.k8s.io
      kind: CustomResourceDefinition
      message: CRD is present and Established condition is true
      name: grafanadatasources.integreatly.org
      status: Present
      uuid: 1b178053-7bd9-4f9c-8351-0293742b910c
      version: v1
    - group: apiextensions.k8s.io
      kind: CustomResourceDefinition
      message: CRD is present and Established condition is true
      name: grafanas.integreatly.org
      status: Present
      uuid: 6f3621f8-912f-4c8e-85a0-60ff9f1d96ea
      version: v1
    - dependents:
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            namespaced
            rule:{"verbs":["get","list","watch","create","update","patch","delete"],"apiGroups":["","coordination.k8s.io"],"resources":["configmaps","leases"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            namespaced
            rule:{"verbs":["create","patch"],"apiGroups":[""],"resources":["events"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["create","delete","get","list","patch","update","watch"],"apiGroups":[""],"resources":["configmaps","persistentvolumeclaims","secrets","serviceaccounts","services"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["create","get","list","watch"],"apiGroups":[""],"resources":["events"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["get","list","watch"],"apiGroups":[""],"resources":["pods"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["create","delete","get","list","patch","update","watch"],"apiGroups":["apps","extensions"],"resources":["deployments","deployments/finalizers"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["create","delete","get","list","patch","update","watch"],"apiGroups":["integreatly.org"],"resources":["grafanadashboards"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["get","patch","update"],"apiGroups":["integreatly.org"],"resources":["grafanadashboards/status"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["create","delete","get","list","patch","update","watch"],"apiGroups":["integreatly.org"],"resources":["grafanadatasources"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["get","patch","update"],"apiGroups":["integreatly.org"],"resources":["grafanadatasources/status"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["create","delete","get","list","patch","update","watch"],"apiGroups":["integreatly.org"],"resources":["grafanas","grafanas/finalizers"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["get","patch","update"],"apiGroups":["integreatly.org"],"resources":["grafanas/status"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["create","delete","get","list","patch","update","watch"],"apiGroups":["networking.k8s.io"],"resources":["ingresses"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["create","delete","get","list","patch","update","watch"],"apiGroups":["route.openshift.io"],"resources":["routes"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["create"],"apiGroups":["authentication.k8s.io"],"resources":["tokenreviews"]}
          status: NotSatisfied
          version: v1
        - group: rbac.authorization.k8s.io
          kind: PolicyRule
          message: >-
            cluster
            rule:{"verbs":["create"],"apiGroups":["authorization.k8s.io"],"resources":["subjectaccessreviews"]}
          status: NotSatisfied
          version: v1
      group: ''
      kind: ServiceAccount
      message: Policy rule not satisfied for service account
      name: default
      status: PresentNotSatisfied
      version: v1

@Bobbins228 Bobbins228 self-requested a review September 15, 2021 10:26
Copy link
Contributor

@Bobbins228 Bobbins228 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to successfully follow the steps posted above and after installing Grafana v4.0 I noticed that my own custom dashboards have been deleted and the dashboards I applied from the example dashboards are still there. Dashboard functionality works as expected. My datasource(Prometheus) is working with no errors and the operator pod is running smoothly. Other than my missing dashboards I have encountered no other problems.

@pb82
Copy link
Collaborator Author

pb82 commented Sep 15, 2021

@Bobbins228 the missing custom dashboards are expected because the Grafana pod gets restarted and those dashboards only exist on the pod unless an external database is used.

@Bobbins228
Copy link
Contributor

@pb82 Okay my bad everything works just fine, nice work Peter.

Copy link
Collaborator

@hubeadmin hubeadmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pb82 @NissesSenap, if you're happy with this, then feel free to merge!

Copy link
Collaborator

@NissesSenap NissesSenap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally have taken the time to try it out .
I used our internal config and we use lots of interesting features in the operator so I think I managed to create a decent test.
LGTM and great job @pb82 as always!

@NissesSenap NissesSenap merged commit fb8ed04 into grafana:master Sep 18, 2021
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

Successfully merging this pull request may close these issues.

4 participants