Skip to content
Snippets Groups Projects
Commit fb175e78 authored by Guillermo Facundo Colunga's avatar Guillermo Facundo Colunga
Browse files

[MONIT-3965] Add support for user defined service monitors in values file

This commits updates the values file to add a new field named `metrics.prometheus.server.serviceMonitors` that is a list that can be used to tell the helm chart to create service monitors on cluster creation time.
Also adds a template to generate this new resource.
parent ffd79a5e
No related branches found
No related tags found
2 merge requests!7QA -> Master,!5[MONIT-3965] Add support for user defined service monitors in values file
{{- if and .Values.metrics.enabled .Values.metrics.prometheus.enabled -}}
{{- if .Values.metrics.prometheus.server.serviceMonitors }}
{{- $top := . -}}
{{- range $t := .Values.metrics.prometheus.server.serviceMonitors }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ $t.name }}
namespace: {{ $top.Release.namespace }}
spec:
{{- toYaml $t.spec | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}
\ No newline at end of file
......@@ -104,7 +104,22 @@ metrics:
limits:
cpu: "500m"
memory: "5Gi"
# Service Monitors to be created by the helm chart install / upgrade. Ex:
# serviceMonitors:
# - name: my-nginx-sm
# spec:
# endpoints:
# - interval: 30s
# port: metrics
# namespaceSelector:
# matchNames:
# - kube-system
# selector:
# matchLabels:
# app.kubernetes.io/component: controller
# app.kubernetes.io/instance: cern-magnum
# app.kubernetes.io/name: ingress-nginx
serviceMonitors: []
# This fluentbit is used to allow scraping and fordwarding metrics from
# the local prometheus and send them to Open Telemetry Collector.
# If the local .Values.metrics.prometheus enable=false will not be able
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment