DRAFT: Add Perses feature flag for the monitoring-console-plugin#655
DRAFT: Add Perses feature flag for the monitoring-console-plugin#655zhuje wants to merge 14 commits intorhobs:mainfrom
Conversation
…rtManager. This is because we want to be able to have the options of creating a Perses proxy only and not include thanosQuerier and the alertManager.
QUESTION : where is the perses dashboard proxy URL coming from, we may need to adjust the code because right now it assumes it is in plugin.Spec.Montioring
|
@zhuje: This pull request references OU-571 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zhuje The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@zhuje: This pull request references OU-571 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
@zhuje: This pull request references OU-571 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
@zhuje: This pull request references OU-571 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
pkg/apis/uiplugin/v1alpha1/types.go
Outdated
|
|
||
| // PersesDashboards points to the perses-dashboards service of which it should create a proxy to. | ||
| // | ||
| // +kubebuilder:validation:Required |
There was a problem hiding this comment.
In general when working with kubebuilder configs you should try to make adjustments in the the go file and then run the make generate command to create the yaml for you. Here you will need to remove the required validations in this file for the monitoring options.
There was a problem hiding this comment.
Updated to // +kubebuilder:validation:Optional then ran make generate and make bundle to update the uiplugin CRDs
| if persesDashboardsFeatureEnabled { | ||
| // JZ OPEN QUESTION: Need to align on PORT number, name, and namespace...with Perses Operator? | ||
| proxy := osv1.ConsolePluginProxy{ | ||
| Alias: "perses-dashboards-proxy", |
There was a problem hiding this comment.
Proxy name should just be perses based on how the monitoring-plugin links are structured (link)
There was a problem hiding this comment.
Updated the Alias: "perses" instead of "perses-dashboard-proxy".
| }, | ||
| } | ||
| pluginInfo.ExtraArgs = append(pluginInfo.ExtraArgs, fmt.Sprintf("-perses-dashboards=%s", config.PersesDashboards.Url)) | ||
| pluginInfo.Proxies = append(pluginInfo.Proxies, proxy) |
There was a problem hiding this comment.
NIT: Rather than assigning to a variable can we just directly put the definition in the append call.
There was a problem hiding this comment.
What do you mean? Can you write an example?
There was a problem hiding this comment.
pluginInfo.ExtraArgs = append(pluginInfo.ExtraArgs, fmt.Sprintf("-perses-dashboards=%s", config.PersesDashboards.Url))
pluginInfo.Proxies = append(pluginInfo.Proxies, osv1.ConsolePluginProxy{
Alias: "perses-dashboards-proxy",
Authorization: "UserToken",
Endpoint: osv1.ConsolePluginProxyEndpoint{
Type: osv1.ProxyTypeService,
Service: &osv1.ConsolePluginProxyServiceConfig{
Name: name,
Namespace: namespace,
Port: 9446,
},
},
})
pluginInfo.LegacyProxies = append(pluginInfo.LegacyProxies, osv1alpha1.ConsolePluginProxy{
Type: "Service",
Alias: "perses-dashboards-proxy",
Authorize: true,
Service: osv1alpha1.ConsolePluginProxyServiceConfig{
Name: name,
Namespace: namespace,
Port: 9446,
},
})There was a problem hiding this comment.
Makes sense, ty! Updated created the objects directly in the append() call
pkg/controllers/uiplugin/utils.go
Outdated
| @@ -0,0 +1,10 @@ | |||
| package uiplugin | |||
|
|
|||
| func contains(array []string, value string) bool { | |||
There was a problem hiding this comment.
As of version 1.18, go now contains a slices.contains method so we no longer need to write one ourselves
…ersesDashboards are not required attributes. Then run `make generate` to update CRDs (rather than manual editing).
…lity.openshift.io_uiplugins.yaml
…" instead of "perses-dashboard-proxy".
… rather than a URL. This because COO controls Perses Operator so COO just needs the ServiceName and Namespace to fetch the Perses Service. Requiring the exact endpoint is less flexible.
…d the name, namespace, and port to connect to the Perses Service.
| Endpoint: osv1.ConsolePluginProxyEndpoint{ | ||
| Type: osv1.ProxyTypeService, | ||
| Service: &osv1.ConsolePluginProxyServiceConfig{ | ||
| Name: name, |
There was a problem hiding this comment.
@jgbernalp @PeterYurkovich Is it necessary to require the PersesDashboardsReference > serviceName in the types.go? I think Service name and namespace are already passed in the props here...
There was a problem hiding this comment.
Those are the name and namespace of the monitoring-plugin, not the perses service
…wn contains() function.
…traArgs' in the PluginInfo
…viceName instead of PersesDashboards.Url should be present in UIPlugin CR
…urce. Update createMonitoringPluginInfo to include name (of service) and namespace. Update CRD (custom resource defintiion) to reflect this too.
|
@zhuje: No Jira issue is referenced in the title of this pull request. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
Closed because moved to new PR : #664 |
/hold
Hold for COO 1.1.0, NOT to be released with COO 1.0.0
JIRA Issue
https://issues.redhat.com/browse/OU-571
Description
Other supporting files
OPEN QUESTIONS:
monitoring.go