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

Add prometheus service to console plugin cr #181

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aruniiird
Copy link
Contributor

This PR patches ConsolePlugin CR, which is generated by ODF operator, with additional ConsolePluginProxy details of Prometheus service, to which console has to connect.

This PR depends on PR #175

@aruniiird aruniiird marked this pull request as draft May 9, 2022 08:22
@aruniiird aruniiird force-pushed the add-prometheus-service-to-console-plugin-cr branch 2 times, most recently from 7a30e6d to 9543092 Compare May 12, 2022 06:07
@aruniiird aruniiird marked this pull request as ready for review May 12, 2022 06:22
@aruniiird aruniiird changed the title [WIP] Add prometheus service to console plugin cr Add prometheus service to console plugin cr May 12, 2022
@aruniiird
Copy link
Contributor Author

Rebased on top of latest main branch, which has PR#175 merged.
Ready for an initial review

controllers/managedocs_controller.go Outdated Show resolved Hide resolved
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
@@ -1752,6 +1759,41 @@ func (r *ManagedOCSReconciler) updateMCGCSV(csv *opv1a1.ClusterServiceVersion) e
return nil
}

func (r *ManagedOCSReconciler) reconcileConsolePlugin() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to run this reconcile func in all deployment modes? (converged, consumer, provider).
If not, please add an if at the start of the function to immediately exist if the deployment type does not match (see other reconcile funcs for reference)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will check and update

Copy link
Contributor Author

@aruniiird aruniiird May 17, 2022

Choose a reason for hiding this comment

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

Console UI plugin is only used in provider / consumer type deployment. The only difference (AFAIU) is in consumer mode both SRE and customers are able to view the dashboard and in provider deployment type only SREs are able to access the console UI. So added the check for the above deployment-types in the beginning of the function.

Copy link
Contributor

@nb-ohad nb-ohad Jul 11, 2022

Choose a reason for hiding this comment

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

-SREs are not logging into the OCP console so this is not relevant for provider mode as well.
Please add an early exit if not in consumer mode (you can find examples in other existing reconcile functions)

controllers/managedocs_controller.go Outdated Show resolved Hide resolved
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
@aruniiird aruniiird force-pushed the add-prometheus-service-to-console-plugin-cr branch from 9543092 to 8dae6ad Compare May 13, 2022 14:34
@nb-ohad
Copy link
Contributor

nb-ohad commented May 15, 2022

@aruniiird Please rename the template to be more specific and match the casing convention we have for templates
templates/consolePlugin.go -> templates/ocsconsoleplugin.go.

File/Directory name casing is important when some contributed are developing on an OS/FS that is case-sensitive

controllers/managedocs_controller.go Show resolved Hide resolved
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
@nb-ohad
Copy link
Contributor

nb-ohad commented May 15, 2022

@aruniiird Can we even merge this PR? what will happen if we run this on an OCP 4.10/4.9/4.8 clusters?

@aruniiird aruniiird force-pushed the add-prometheus-service-to-console-plugin-cr branch from 8dae6ad to 572e521 Compare May 16, 2022 10:05
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
@aruniiird aruniiird force-pushed the add-prometheus-service-to-console-plugin-cr branch from 572e521 to 35b09fa Compare May 16, 2022 12:00
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
controllers/managedocs_controller.go Outdated Show resolved Hide resolved
@aruniiird aruniiird force-pushed the add-prometheus-service-to-console-plugin-cr branch 5 times, most recently from 389121e to 536cdef Compare May 17, 2022 06:15
)

const (
ocpConsoleProxyAlias = "consoleproxy"

Choose a reason for hiding this comment

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

Suggested change
ocpConsoleProxyAlias = "consoleproxy"
ocpConsoleProxyAlias = "odf-managed-service-prom"

Please use this. This is something we discussed before and is used in the UI as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@aruniiird aruniiird force-pushed the add-prometheus-service-to-console-plugin-cr branch 2 times, most recently from cc2a01b to 77452f6 Compare June 17, 2022 11:45
@leelavg
Copy link
Collaborator

leelavg commented Sep 27, 2022

hey @aruniiird / @SanjalKatiyar is this PR related to https://issues.redhat.com/browse/ODFMS-281? we are about to start work on this task.

cc: @rchikatw

@SanjalKatiyar
Copy link

hey @aruniiird / @SanjalKatiyar is this PR related to https://issues.redhat.com/browse/ODFMS-281? we are about to start work on this task.

cc: @rchikatw

hey...
yeah if we want dashboard to poll from external prom then we have to add service details to consolePlugin CR

@aruniiird aruniiird force-pushed the add-prometheus-service-to-console-plugin-cr branch from 77452f6 to e58d9b2 Compare October 3, 2022 09:17
@rchikatw
Copy link
Contributor

/hold

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 9, 2023
@openshift-merge-robot
Copy link

PR needs rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants