diff options
author | Rashmi Pujar <rashmi.pujar1@bell.ca> | 2022-03-15 21:58:57 -0400 |
---|---|---|
committer | Rashmi Pujar <rashmi.pujar1@bell.ca> | 2022-03-21 01:29:40 +0000 |
commit | a8b09265770c1212cb4b0872adfbed2a4f7c1549 (patch) | |
tree | 822ce993ccb68e641f2e03594c8fcab40078a6fa /kubernetes/common | |
parent | db93f8696ea251334f2b2a389843cec82a130e75 (diff) |
[POLICY] Enable prometheus integration for policy fwk
1. Define serviceMonitor for policy components
2. Changes to common serviceMonitor tpl file to include
tls params in authentication config, and to provide ability
to overrride labels.
Issue-ID: POLICY-3779
Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca>
Change-Id: I79441958698271d9118efb78cfd121433e201ebd
Diffstat (limited to 'kubernetes/common')
-rw-r--r-- | kubernetes/common/common/templates/_serviceMonitor.tpl | 21 |
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 }} |