Files
charts/bitnami/node-exporter/templates/servicemonitor.yaml
Federico Marzocchi 86669a5593 [bitnami/node-exporter] Allow setting ServiceMonitor's sampleLimit (#19322)
* [bitnami/node-exporter] Allow setting ServiceMonitor's sampleLimit

Signed-off-by: Federico Marzocchi <federico.marzocchi@deliveryhero.com>

* Fix typo

Signed-off-by: Celia Garcia <61272496+CeliaGMqrz@users.noreply.github.com>

---------

Signed-off-by: Federico Marzocchi <federico.marzocchi@deliveryhero.com>
Signed-off-by: Celia Garcia <61272496+CeliaGMqrz@users.noreply.github.com>
Co-authored-by: Celia Garcia <61272496+CeliaGMqrz@users.noreply.github.com>
2023-09-19 14:06:15 +02:00

57 lines
2.6 KiB
YAML

{{- /*
Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "common.names.fullname" . }}
namespace: {{ default (include "common.names.namespace" .) .Values.serviceMonitor.namespace | quote }}
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.serviceMonitor.labels .Values.commonLabels ) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations:
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.serviceMonitor.sampleLimit }}
sampleLimit: {{ .Values.serviceMonitor.sampleLimit }}
{{- end }}
{{- if .Values.serviceMonitor.jobLabel }}
jobLabel: {{ .Values.serviceMonitor.jobLabel }}
{{- end }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
{{- if .Values.serviceMonitor.selector }}
{{- include "common.tplvalues.render" (dict "value" .Values.serviceMonitor.selector "context" $) | nindent 6 }}
{{- end }}
endpoints:
- port: metrics
{{- if .Values.serviceMonitor.interval }}
interval: {{ .Values.serviceMonitor.interval }}
{{- end }}
{{- if .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.serviceMonitor.basicAuth }}
basicAuth: {{- include "common.tplvalues.render" ( dict "value" .Values.serviceMonitor.basicAuth "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.serviceMonitor.honorLabels }}
honorLabels: {{ .Values.serviceMonitor.honorLabels }}
{{- end }}
{{- if .Values.serviceMonitor.relabelings }}
relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.serviceMonitor.relabelings "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.serviceMonitor.metricRelabelings "context" $) | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ include "common.names.namespace" . }}
{{- if .Values.serviceMonitor.attachMetadata }}
attachMetadata: {{- include "common.tplvalues.render" ( dict "value" .Values.serviceMonitor.attachMetadata "context" $) | nindent 4 }}
{{- end }}
{{- end }}