Skip to content

Add OpenShift Dashboards for GitOps #589

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

Merged
merged 11 commits into from
Aug 30, 2023

Conversation

gnunn1
Copy link
Collaborator

@gnunn1 gnunn1 commented Aug 23, 2023

What type of PR is this?

Uncomment only one /kind line, and delete the rest.
For example, > /kind bug would simply become: /kind bug

/kind enhancement

What does this PR do / why we need it:

This provisions a set of dashboards in the OpenShift console (Observer > Dashboards) to provide monitoring for GitOps. These dashboards are based on the upstream Argo CD dashboards but have been modified to work with the OpenShift console which has a reduced feature set compared to Grafana.

Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

https://issues.redhat.com/browse/GITOPS-1767

Fixes #?

GITOPS-1767

Test acceptance criteria:

  • [*] Unit Test
  • E2E Test

How to test changes / Special notes to the reviewer:

Install the GitOps Operator on an OpenShift cluster and then navigate to Observe > Dashboards in the console. In the dropdown list of dashboards note that three new dashboards are now available:

  • GitOps Overview
  • GitOps Components
  • GitOps gRPC

@openshift-ci openshift-ci bot added the kind/enhancement New feature or request label Aug 23, 2023
@openshift-ci openshift-ci bot requested review from jgwest and mehabhalodiya August 23, 2023 20:56
@openshift-ci
Copy link

openshift-ci bot commented Aug 23, 2023

Hi @gnunn1. Thanks for your PR.

I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jaideepr97
Copy link
Contributor

Thanks @gnunn1, I tested this out and it works great!
One other point I would mention is maybe we can move the dashboards folder out of the controllers folder and keep it at the same level as the controllers folder

@gnunn1
Copy link
Collaborator Author

gnunn1 commented Aug 24, 2023

Moving dashboards outside of controllers doesn't work for me, there are some limitations around go embed with respect to where the content is located.

The go:embed directive only works with files that are accessible from the current working directory or a subdirectory of it. This means that you cannot use the go:embed directive to embed files outside of your project directory or in a parent directory.

https://www.iamyadav.com/blogs/a-guide-to-embedding-static-files-in-go

@gnunn1
Copy link
Collaborator Author

gnunn1 commented Aug 24, 2023

I have made the requested changes plus added the ability for it to update the dashboard configmap if the data element doesn't match the expectation.

reqLogger.Error(err, "Error creating a new dashboard",
"Namespace", dashboard.Namespace, "Name", dashboard.Name)
// Should we return an error or continue with other dashboards?
return err
Copy link
Contributor

@jaideepr97 jaideepr97 Aug 24, 2023

Choose a reason for hiding this comment

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

I think we should continue with other dashboards here, unless they only make sense in context of each other.
If that is not that case, and there is value in viewing each dashboard independently, we should not return error here

same for line 332 as well

@wtam2018
Copy link
Collaborator

/ok-to-test

@openshift-ci
Copy link

openshift-ci bot commented Aug 28, 2023

@gnunn1: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v4.14-kuttl-sequential-periodic f76ec95 link true /test v4.14-kuttl-sequential-periodic

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@reginapizza
Copy link
Contributor

/retest

Copy link
Contributor

@jaideepr97 jaideepr97 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thanks a lot @gnunn1!

@jaideepr97 jaideepr97 removed the request for review from jgwest August 30, 2023 16:15
@openshift-ci
Copy link

openshift-ci bot commented Aug 30, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jaideepr97

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit c3e522b into redhat-developer:master Aug 30, 2023
trdoyle81 pushed a commit to trdoyle81/gitops-operator that referenced this pull request Aug 13, 2024
* Provision dashboards for OpenShift Console

* Create constant for dashboards folder path

* Add unit test

* Improve error message when dashboard namespace is not available

* Remove redis graph due to upstream bug not exposing stats

* Update function name and message as per Jaideep's review comments

* Reconcile dashboards if data in configmap changes

* Change name to reconcileDashboards since we are now doing reconciliation and not just create

* Continue processing dashboards if error occurs instead of stopping

* Continue processing dashboards if new dashboard creation fails

---------

Co-authored-by: William Tam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants