aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/common')
-rw-r--r--kubernetes/common/common/templates/_serviceMonitor.tpl21
1 files changed, 21 insertions, 0 deletions
diff --git a/kubernetes/common/common/templates/_serviceMonitor.tpl b/kubernetes/common/common/templates/_serviceMonitor.tpl
index eb6c047c2f..81d7a74578 100644
--- a/kubernetes/common/common/templates/_serviceMonitor.tpl
+++ b/kubernetes/common/common/templates/_serviceMonitor.tpl
@@ -110,8 +110,12 @@ namespace: {{ $dot.Values.metrics.serviceMonitor.namespace }}
{{- else }}
namespace: {{ include "common.namespace" $dot }}
{{- end }}
+{{- if $dot.Values.metrics.serviceMonitor.labels }}
+labels: {{- include "common.tplValue" ( dict "value" $dot.Values.metrics.serviceMonitor.labels "context" $dot) | nindent 2 }}
+{{- else }}
labels: {{- include "common.labels" (dict "labels" $labels "dot" $dot) | nindent 2 }}
{{- end -}}
+{{- end -}}
{{/*
Create service monitor template
@@ -133,14 +137,31 @@ spec:
{{- else }}
port: metrics
{{- end }}
+ {{- if $dot.Values.metrics.serviceMonitor.isHttps }}
+ scheme: https
+ {{- if $dot.Values.metrics.serviceMonitor.tlsConfig }}
+ tlsConfig: {{- include "common.tplValue" ( dict "value" $dot.Values.metrics.serviceMonitor.tlsConfig "context" $dot) | nindent 6 }}
+ {{- else }}
+ tlsConfig:
+ insecureSkipVerify: true
+ {{- end }}
+ {{- end }}
{{- if $dot.Values.metrics.serviceMonitor.basicAuth.enabled }}
basicAuth:
username:
key: {{ $dot.Values.metrics.serviceMonitor.basicAuth.externalSecretUserKey }}
+ {{- if $dot.Values.metrics.serviceMonitor.basicAuth.externalSecretNameSuffix }}
+ name: {{ include "common.release" . }}-{{ $dot.Values.metrics.serviceMonitor.basicAuth.externalSecretNameSuffix }}
+ {{- else }}
name: {{ $dot.Values.metrics.serviceMonitor.basicAuth.externalSecretName }}
+ {{- end }}
password:
key: {{ $dot.Values.metrics.serviceMonitor.basicAuth.externalSecretPasswordKey }}
+ {{- if $dot.Values.metrics.serviceMonitor.basicAuth.externalSecretNameSuffix }}
+ name: {{ include "common.release" . }}-{{ $dot.Values.metrics.serviceMonitor.basicAuth.externalSecretNameSuffix }}
+ {{- else }}
name: {{ $dot.Values.metrics.serviceMonitor.basicAuth.externalSecretName }}
+ {{- end }}
{{- end }}
{{- if $dot.Values.metrics.serviceMonitor.interval }}
interval: {{ $dot.Values.metrics.serviceMonitor.interval }}