Fix prometheus servicemonitor and rules handling.

Labels are not required but needed due to the current notation.
This changes the labelling inclusion to use a syntax that works,
also when the user does not set additional labels.

Signed-off-by: Omar Pakker <Omar007@users.noreply.github.com>
This commit is contained in:
Omar Pakker 2023-05-04 19:39:21 +02:00
parent 2d26873d89
commit b86a049e38
2 changed files with 6 additions and 2 deletions

View file

@ -6,7 +6,9 @@ metadata:
name: {{ include "dendrite.fullname" . }}
labels:
{{- include "dendrite.labels" . | nindent 4 }}
{{- toYaml .Values.prometheus.rules.labels | nindent 4 }}
{{- with .Values.prometheus.rules.labels }}
{{- . | toYaml | nindent 4 }}
{{- end }}
spec:
groups:
{{- if .Values.prometheus.rules.additionalRules }}

View file

@ -9,7 +9,9 @@ metadata:
name: {{ include "dendrite.fullname" . }}
labels:
{{- include "dendrite.labels" . | nindent 4 }}
{{- toYaml .Values.prometheus.servicemonitor.labels | nindent 4 }}
{{- with .Values.prometheus.servicemonitor.labels }}
{{- . | toYaml | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: http