fix(collabora): Init monitoring in defaults and in collabora (for prometheus-monitor, -rules and grafana dashboard)

This commit is contained in:
Martin Müller
2023-10-04 17:24:48 +02:00
committed by Dominik Kaminski
parent 4a79728f01
commit 0ad043406b
3 changed files with 134 additions and 0 deletions

View File

@@ -441,6 +441,99 @@ Helm Charts which are released via openDesk CI/CD process are always signed. The
| xwiki-repo | no | :x: |
## Monitoring
For a monitoring openDesk has an optional deployment of Kubernetes Resources for the usage with [Prometheus Operator](https://prometheus-operator.dev).
There is an easy all in one Monitoring helm-chart
[kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack)
which also deployes an Grafana as sub-helmchart.
### Metrics (pod- and serviceMonitor)
To deploy podMonitor and serviceMonitor, enable it by:
```yaml
prometheus:
monitor:
enabled: true
```
### Alerts (prometheusRules)
Some helm-charts provide a default set of prometheusRules for alerting
To deploy prometheusRules (alerts), enable it by:
```yaml
prometheus:
rules:
enabled: true
```
### Non default Prometheus setup
An Prometheus Instance (deployed by Prometheus-Operator)
search for Kubernetes-Resources by his labels
on kube-prometheus-stack the default-value are "release=kube-prometheus-stack".
If you use a different Prometheus-Setup, maybe you like to adjust the labels:
```yaml
prometheus:
monitor:
labels:
release: "kube-prometheus-stack"
rules:
labels:
release: "kube-prometheus-stack"
```
### Dashboards for Grafana
The default Grafana helm-chart is able to collect this with an pre installed sidecar
Deploy optional ConfigMaps with grafana dashboards.
```yaml
grafana:
dashboards:
enabled: true
```
#### Non default Grafana setup
The pre installed sidecar of grafana search for ConfigMaps and Secrets by his labels
on default value is "grafana_dashboard=1".
If you use a different setup, maybe you like to adjust the labels:
```yaml
grafana:
dashboards:
labels:
grafana_dashboard: "1"
```
#### Put Dashboards in Grafana folder
usefull for putting dashboards in folder
https://github.com/grafana/helm-charts/tree/grafana-6.58.6/charts/grafana#configuration
if in grafana helmchart `sidecar.dashboards.folderAnnotation` and `sidecar.dashboards.provider.foldersFromFilesStructure` set
or in [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack):
```yaml
grafana:
sidecar:
dashboards:
folderAnnotation: "grafana-dashboard-folder"
provider:
foldersFromFilesStructure: true
```
Afterward you could configure openDesk with this helmfile to use the directory e.g. "openDesk":
```yaml
grafana:
dashboards:
annotations:
"grafana-dashboard-folder": "openDesk"
```
### Components
| Component | Metrics (pod- or serviceMonitor) | Alerts (prometheusRule) | Dashboard (Grafana) |
|:------------|-----------------------------------|-------------------------|---------------------|
| Collabora | :white_check_mark: | :white_check_mark: | :white_check_mark: |
# Component integration
## Functional use cases

View File

@@ -38,4 +38,23 @@ replicaCount: {{ .Values.replicas.collabora }}
resources:
{{ .Values.resources.collabora | toYaml | nindent 2 }}
prometheus:
servicemonitor:
enabled: {{ .Values.prometheus.monitor.enabled }}
labels:
{{- toYaml .Values.prometheus.monitor.labels | nindent 6 }}
rules:
enabled: {{ .Values.prometheus.rules.enabled }}
additionalLabels:
{{- toYaml .Values.prometheus.rules.labels | nindent 6 }}
grafana:
dashboards:
enabled: {{ .Values.grafana.dashboards.enabled }}
labels:
{{- toYaml .Values.grafana.dashboards.labels | nindent 6 }}
annotations:
{{- toYaml .Values.grafana.dashboards.annotations | nindent 6 }}
...

View File

@@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: 2023 Bundesministerium des Innern und für Heimat, PG ZenDiS "Projektgruppe für Aufbau ZenDiS"
# SPDX-License-Identifier: Apache-2.0
---
prometheus:
monitor:
enabled: false
labels:
release: "kube-prometheus-stack"
rules:
enabled: false
labels:
release: "kube-prometheus-stack"
grafana:
dashboards:
enabled: false
labels:
grafana_dashboard: "1"
annotations:
...