diff --git a/README.md b/README.md index 833b827a..6bb83b1d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/helmfile/apps/collabora/values.gotmpl b/helmfile/apps/collabora/values.gotmpl index 621dc6b6..1d76edf0 100644 --- a/helmfile/apps/collabora/values.gotmpl +++ b/helmfile/apps/collabora/values.gotmpl @@ -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 }} + ... diff --git a/helmfile/environments/default/monitoring.yaml b/helmfile/environments/default/monitoring.yaml new file mode 100644 index 00000000..edd9ef2d --- /dev/null +++ b/helmfile/environments/default/monitoring.yaml @@ -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: +...