feat(mycloud-services): enable monitoring

This commit is contained in:
WrenIX 2025-04-11 12:36:36 +02:00
parent f118c878d1
commit b99df46cbf
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5
4 changed files with 48 additions and 3 deletions

View file

@ -19,6 +19,15 @@ A Helm chart for Kubernetes
## Values
### Commons Monitoring
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| commons.grafana.dashboards.annotations | object | `{}` | annotations of grafana dashboard configmap |
| commons.grafana.dashboards.labels | object | `{}` | labels of grafana dashboard configmap |
| commons.prometheus.monitor.labels | object | `{}` | labels on Pod- and Service-Monitor |
| commons.prometheus.rules.labels | object | `{}` | labels on PrometheusRules |
### Commons helm release
| Key | Type | Default | Description |

View file

@ -7,7 +7,7 @@ spec:
url: oci://codeberg.org/wrenix/helm-charts/postgresql
interval: 10m
ref:
semver: "^0.2.6"
semver: "^0.3.0"
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
@ -28,7 +28,7 @@ spec:
interval: 10m
valuesFrom:
- kind: Secret
name: mycloud-services-postgresql
name: {{.Release.Name }}-pgsql
values:
persistence:
size: {{ .Values.postgresql.persistence.size }}
@ -53,3 +53,20 @@ spec:
{{- end }}
{{- end }}
{{- end }}
prometheus:
enabled: {{ (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }}
servicemonitor:
enabled: {{ (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }}
labels:
{{- toYaml .Values.commons.prometheus.monitor.labels | nindent 10 }}
rules:
enabled: {{ (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule") }}
labels:
{{- toYaml .Values.commons.prometheus.rules.labels | nindent 10 }}
grafana:
dashboards:
enabled: true
labels:
{{- toYaml .Values.commons.grafana.dashboards.labels | nindent 10 }}
annotations:
{{- toYaml .Values.commons.grafana.dashboards.annotations | nindent 10 }}

View file

@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: mycloud-services-postgresql
name: {{.Release.Name }}-pgsql
stringData:
values.yaml: |
job:

View file

@ -30,6 +30,25 @@ commons:
# @section -- Commons helm release
driftDetection: {}
prometheus:
monitor:
# -- labels on Pod- and Service-Monitor
# @section -- Commons Monitoring
labels: {}
rules:
# -- labels on PrometheusRules
# @section -- Commons Monitoring
labels: {}
grafana:
dashboards:
# -- labels of grafana dashboard configmap
# @section -- Commons Monitoring
labels: {}
# -- annotations of grafana dashboard configmap
# @section -- Commons Monitoring
annotations: {}
postgresql:
persistence:
storageClass: