-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: OU-571 Add Perses Flag #664
base: main
Are you sure you want to change the base?
Conversation
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
26eab0f
to
db5581f
Compare
db5581f
to
15ffcc9
Compare
if v.PluginType == "Monitoring" && slices.Contains(v.Features, "perses-dashboards") { | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why do we need this exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It allows the PluginType: uiv1alpha1.TypeMonitoring
multiple cases where "MaxClusterVersion" is empty. I've includes the code snippet below that defines the cases.
The issue is if OCP is v4.19+ we need to create cases where ACM is present and absent. In both these cases MaxClusterVersion: ""
.
# compatibility_matrix.go
var compatibilityMatrix = []CompatibilityEntry{
...
{
PluginType: uiv1alpha1.TypeMonitoring,
MinClusterVersion: "v4.19",
MaxClusterVersion: "",
ImageKey: "ui-monitoring",
MinAcmVersion: "v2.11",
MaxAcmVersion: "",
SupportLevel: DevPreview,
Features: []string{
"acm-alerting",
"perses-dashboards",
},
},
{
PluginType: uiv1alpha1.TypeMonitoring,
MinClusterVersion: "v4.14",
MaxClusterVersion: "",
ImageKey: "ui-monitoring",
MinAcmVersion: "v2.11",
MaxAcmVersion: "",
SupportLevel: DevPreview,
Features: []string{
"acm-alerting",
},
},
{
PluginType: uiv1alpha1.TypeMonitoring,
MinClusterVersion: "v4.19",
MaxClusterVersion: "",
ImageKey: "ui-monitoring",
MinAcmVersion: "",
MaxAcmVersion: "",
SupportLevel: DevPreview,
Features: []string{
"perses-dashboards",
},
},
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be only one MaxClusterVersion. Perses flag won't be enabled by default, on dev preview will be an admin choice. We should test that it should be present when we enable Perses using the perses field in the UIPlugin CR, the compatibility matrix is built to enable by default plugin features based on cluster or ACM versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update so that only one MaxClusterVersion and the "perses-dashboards" flag is not enabled by default.
}, | ||
{ | ||
pluginType: uiv1alpha1.TypeMonitoring, | ||
clusterVersion: "v4.19", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cluster version for Perses could be lower as in older versions Perses dashboards can be added as a new Menu item. Nothing to block this PR as this can be adjusted when we decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll leave it as is for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perses will be supported from 4.14. We need to adjust the logic to validate this cluster version if Perses is enabled in the UIPlugin CR, but not on the compatibility matrix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest push allows "perses-dashboards" feature flag to be added on OCP 4.14+.
}, | ||
} | ||
|
||
if persesDashboardsFeatureEnabled && !invalidPersesConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic seems a bit complex to maintain, we can maybe fail first if Perses or ACM configuration is not set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the latest commit, I updated the logic in monitoring.go. It validates and fails first if Perses or ACM configuration is not set.
/hold |
85e113b
to
81002e1
Compare
81002e1
to
ab5e989
Compare
5f38854
to
8e2364f
Compare
JIRA Issue
https://issues.redhat.com/browse/OU-571
Description
perses-dashboards
flag in the arguments for the monitoring-console-plugin's Deployment; we then can use this flag to render the Perses Dashboard component.Figure 1. The second screen shows UIPlugin configuration for perses, the third screen shows the
alias: perses
being listed as a proxy within the ConsolePlugin CR for the monitoring-console-plugin, the fourth screen shows the--feature='perses-dashboards
being listed in the Deployment for the monitoring-console-plugin.Changes
+kubebuilder validations/webhooks
to validate the UIPlugin custom resources for type: monitoring. monitoring.go checks if thanosQuerier URL, alertManager URL, perses name, and namespace are not empty.Testing
Login into a OCP v4.19+ cluster
set
openshift.enabled
to true inmain.go
Troubleshooting
mac specific troubleshooting
sed commands need to be adjusted on macOS update
sed ... -i
tosed ... -i ''
.Alternatively, install https://formulae.brew.sh/formula/gnu-sed and add it to your path to replace "sed"
If uninstall is hung
n the editor, find the finalizers field under metadata, and remove any finalizers (it will look something like this):
After removing the finalizer(s), save and exit the editor. This should allow the CRD to be deleted.
VSCode Local Debugger configurations