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

feat: OU-571 Add Perses Flag #664

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions bundle/manifests/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,19 @@ spec:
properties:
url:
description: Url of the Alertmanager to proxy to.
minLength: 1
type: string
required:
- url
type: object
x-kubernetes-map-type: atomic
perses:
description: Perses points to the perses instance service of which
it should create a proxy to.
properties:
name:
description: Name of the Perses Service to proxy to.
type: string
namespace:
description: Namespace of the Perses Service to proxy to.
type: string
type: object
x-kubernetes-map-type: atomic
thanosQuerier:
Expand All @@ -162,15 +171,9 @@ spec:
properties:
url:
description: Url of the ThanosQuerier to proxy to.
minLength: 1
type: string
required:
- url
type: object
x-kubernetes-map-type: atomic
required:
- alertmanager
- thanosQuerier
type: object
troubleshootingPanel:
description: TroubleshootingPanel contains configuration for the troubleshooting
Expand Down
21 changes: 12 additions & 9 deletions deploy/crds/common/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,19 @@ spec:
properties:
url:
description: Url of the Alertmanager to proxy to.
minLength: 1
type: string
required:
- url
type: object
x-kubernetes-map-type: atomic
perses:
description: Perses points to the perses instance service of which
it should create a proxy to.
properties:
name:
description: Name of the Perses Service to proxy to.
type: string
namespace:
description: Namespace of the Perses Service to proxy to.
type: string
type: object
x-kubernetes-map-type: atomic
thanosQuerier:
Expand All @@ -162,15 +171,9 @@ spec:
properties:
url:
description: Url of the ThanosQuerier to proxy to.
minLength: 1
type: string
required:
- url
type: object
x-kubernetes-map-type: atomic
required:
- alertmanager
- thanosQuerier
type: object
troubleshootingPanel:
description: TroubleshootingPanel contains configuration for the troubleshooting
Expand Down
49 changes: 45 additions & 4 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4173,14 +4173,21 @@ Monitoring contains configuration for the monitoring console plugin.
<td>
Alertmanager points to the alertmanager instance of which it should create a proxy to.<br/>
</td>
<td>true</td>
<td>false</td>
</tr><tr>
<td><b><a href="#uipluginspecmonitoringperses">perses</a></b></td>
<td>object</td>
<td>
Perses points to the perses instance service of which it should create a proxy to.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#uipluginspecmonitoringthanosquerier">thanosQuerier</a></b></td>
<td>object</td>
<td>
ThanosQuerier points to the thanos-querier service of which it should create a proxy to.<br/>
</td>
<td>true</td>
<td>false</td>
</tr></tbody>
</table>

Expand All @@ -4207,7 +4214,41 @@ Alertmanager points to the alertmanager instance of which it should create a pro
<td>
Url of the Alertmanager to proxy to.<br/>
</td>
<td>true</td>
<td>false</td>
</tr></tbody>
</table>


### UIPlugin.spec.monitoring.perses
<sup><sup>[↩ Parent](#uipluginspecmonitoring)</sup></sup>



Perses points to the perses instance service of which it should create a proxy to.

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>name</b></td>
<td>string</td>
<td>
Name of the Perses Service to proxy to.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>namespace</b></td>
<td>string</td>
<td>
Namespace of the Perses Service to proxy to.<br/>
</td>
<td>false</td>
</tr></tbody>
</table>

Expand All @@ -4234,7 +4275,7 @@ ThanosQuerier points to the thanos-querier service of which it should create a p
<td>
Url of the ThanosQuerier to proxy to.<br/>
</td>
<td>true</td>
<td>false</td>
</tr></tbody>
</table>

Expand Down
27 changes: 19 additions & 8 deletions docs/user-guides/observability-ui-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,17 @@ spec:

### Monitoring

The plugin adds monitoring related UI features to the OpenShift web console, mostly related to the ACM perspective. A number of new pages and features are enabled through this plugin. Including, but not limited to:
The plugin adds monitoring related UI features to the OpenShift web console, related to the Advance Cluster Management (ACM) perspective and [Perses](https://github.com/perses/perses). A number of new pages and features are enabled through this plugin. Including, but not limited to:
- `ACM > Observe > Alerting`
- `ACM > Observe > Alerting > Silences`
- `ACM > Observe > Alerting > Alert rules`
- `OCP > Observe > Perses Dashboards`

This plugin is only able to be deployed by COO with the `acm-alerting` configuration enabled. Other pages which are typically distributed with the monitoring-plugin, such as `Admin > Observe > Dashboards`, are only available in the monitoring-plugin when deployed through [CMO](https://github.com/openshift/cluster-monitoring-operator).
To deploy ACM related features the `acm-alerting` configuration must be enabled. In the UIPlugin Custom Resource (CR) you must pass the Alertmanager and ThanosQuerier Service endpoint (e.g. `https://alertmanager.open-cluster-management-observability.svc:9095` and `https://rbac-query-proxy.open-cluster-management-observability.svc:8443`). See the example in the next section `Plugin Creation`.

Other pages which are typically distributed with the monitoring-plugin, such as `Admin > Observe > Dashboards`, are only available in the monitoring-plugin when deployed through [CMO](https://github.com/openshift/cluster-monitoring-operator).

To deploy the Perses dashboard feature the `perses-dashboards` configuration must be enabled. In the UIPlugin CR you can optionally pass the service name and namespace of your Perses instance (e.g. `perses-api-http` and namespace `perses-operator`). See the example in the next section `Plugin Creation`.

#### Plugin Creation

Expand All @@ -159,16 +164,22 @@ spec:
url: 'https://alertmanager.open-cluster-management-observability.svc:9095'
thanosQuerier:
url: 'https://rbac-query-proxy.open-cluster-management-observability.svc:8443'
perses:
name: 'perses-api-http'
namespace: 'perses-operator'
```

#### Feature List

| __Feature__ | __Description__ |
| -------------- | --------------------------------------------------------------------------------------------------------------- |
| `acm-alerting` | Adds alerting UI to multi-cluster view. Configures proxies to connect with any alertmanager and thanos-querier. |
| __Feature__ | __Description__ |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `acm-alerting` | Adds alerting UI to multi-cluster view. Configures proxies to connect with any alertmanager and thanos-querier. |
| `perses-dashboards` | Adds perses UI to `Observe` section of OpenShift Console Platform. Configures proxies to connect with a Perses instance. |


#### Feature Matrix

| __COO Version__ | __OCP Versions__ | __Features__ |
| --------------- | ------------------- | -------------- |
| 1.0.0+ | 4.14+ | `acm-alerting` |
| __COO Version__ | __OCP Versions__ | __Features__ |
| --------------- | ------------------- | --------------------------------- |
| 1.0.0+ | 4.14+ | `acm-alerting` |
| 1.1.0+ | 4.14+ | `acm-alerting, perses-dashboards` |
38 changes: 28 additions & 10 deletions pkg/apis/uiplugin/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,18 @@ type LokiStackReference struct {
type MonitoringConfig struct {
// Alertmanager points to the alertmanager instance of which it should create a proxy to.
//
// +kubebuilder:validation:Required
Alertmanager AlertmanagerReference `json:"alertmanager"`
// +kubebuilder:validation:Optional
Alertmanager AlertmanagerReference `json:"alertmanager,omitempty"`

// ThanosQuerier points to the thanos-querier service of which it should create a proxy to.
//
// +kubebuilder:validation:Required
ThanosQuerier ThanosQuerierReference `json:"thanosQuerier"`
// +kubebuilder:validation:Optional
ThanosQuerier ThanosQuerierReference `json:"thanosQuerier,omitempty"`

// Perses points to the perses instance service of which it should create a proxy to.
//
// +kubebuilder:validation:Optional
Perses PersesReference `json:"perses,omitempty"`
}

// Alertmanager is used to configure a reference to a alertmanage that should be used
Expand All @@ -155,9 +160,8 @@ type MonitoringConfig struct {
type AlertmanagerReference struct {
// Url of the Alertmanager to proxy to.
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength:=1
Url string `json:"url"`
// +kubebuilder:validation:Optional
Url string `json:"url,omitempty"`
}

// ThanosQuerier is used to configure a reference to a thanos-querier service that should be used
Expand All @@ -167,9 +171,23 @@ type AlertmanagerReference struct {
type ThanosQuerierReference struct {
// Url of the ThanosQuerier to proxy to.
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength:=1
Url string `json:"url"`
// +kubebuilder:validation:Optional
Url string `json:"url,omitempty"`
}

// Perses is used to configure a reference to a perses service that should be used
// by the monitoring console plugin.
//
// +structType=atomic
type PersesReference struct {
// Name of the Perses Service to proxy to.
//
// +kubebuilder:validation:Optional
Name string `json:"name,omitempty"`
// Namespace of the Perses Service to proxy to.
//
// +kubebuilder:validation:Optional
Namespace string `json:"namespace,omitempty"`
}

// UIPluginSpec is the specification for desired state of UIPlugin.
Expand Down
16 changes: 16 additions & 0 deletions pkg/apis/uiplugin/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading