Skip to content

Commit

Permalink
Add labels from global.commonLabels and prometheus.serviceMonitor.lab…
Browse files Browse the repository at this point in the history
…els if defined
  • Loading branch information
lou-lan committed Nov 28, 2024
1 parent f9b202f commit bd6f205
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion charts/spiderpool/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ metadata:
name: {{ .Values.spiderpoolAgent.name | trunc 63 | trimSuffix "-" }}
namespace: {{ default .Release.Namespace .Values.spiderpoolAgent.prometheus.serviceMonitor.namespace }}
labels:
{{- if .Values.global.commonLabels }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.spiderpoolAgent.prometheus.serviceMonitor.labels }}
{{- include "tplvalues.render" ( dict "value" .Values.grafanaDashboard.labels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.global.commonAnnotations .Values.spiderpoolAgent.prometheus.serviceMonitor.annotations }}
annotations:
{{- if .Values.global.commonAnnotations }}
Expand Down Expand Up @@ -36,6 +42,13 @@ kind: ServiceMonitor
metadata:
name: {{ .Values.spiderpoolController.name | trunc 63 | trimSuffix "-" }}
namespace: {{ default .Release.Namespace .Values.spiderpoolController.prometheus.serviceMonitor.namespace }}
labels:
{{- if .Values.global.commonLabels }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.spiderpoolController.prometheus.serviceMonitor.labels }}
{{- include "tplvalues.render" ( dict "value" .Values.grafanaDashboard.labels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.global.commonAnnotations .Values.spiderpoolController.prometheus.serviceMonitor.annotations }}
annotations:
{{- if .Values.global.commonAnnotations }}
Expand All @@ -59,4 +72,4 @@ spec:
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 6 }}
{{- end }}
{{- include "spiderpool.spiderpoolController.selectorLabels" . | nindent 6 }}
{{- end }}
{{- end }}

0 comments on commit bd6f205

Please sign in to comment.