2024-03-24 20:26:55 +00:00
{{- $apiVersion := include "argo-workflows.apiVersions.monitoring" . }}
{{- if and (.Capabilities.APIVersions.Has $apiVersion) (or .Values.controller.metricsConfig.enabled .Values.controller.telemetryConfig.enabled) .Values.controller.serviceMonitor.enabled }}
apiVersion : {{ $apiVersion }}
2021-05-21 12:19:05 +00:00
kind : ServiceMonitor
metadata :
name : {{ template "argo-workflows.controller.fullname" . }}
2024-03-03 19:12:41 +00:00
namespace : {{ default (include "argo-workflows.namespace" .) .Values.controller.serviceMonitor.namespace | quote }}
2021-05-21 12:19:05 +00:00
labels :
{{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- with .Values.controller.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec :
endpoints :
{{- if .Values.controller.metricsConfig.enabled }}
2023-05-25 12:30:48 +00:00
- port : {{ .Values.controller.metricsConfig.servicePortName }}
2021-05-21 12:19:05 +00:00
path : {{ .Values.controller.metricsConfig.path }}
interval : 30s
2023-04-24 16:57:36 +00:00
{{- with .Values.controller.metricsConfig.relabelings }}
relabelings :
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.metricsConfig.metricRelabelings }}
metricRelabelings :
{{- toYaml . | nindent 8 }}
{{- end }}
2021-05-21 12:19:05 +00:00
{{- end }}
{{- if .Values.controller.telemetryConfig.enabled }}
- port : telemetry
path : {{ .Values.controller.telemetryConfig.path }}
interval : 30s
2023-04-24 16:57:36 +00:00
{{- with .Values.controller.metricsConfig.relabelings }}
relabelings :
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.metricsConfig.metricRelabelings }}
metricRelabelings :
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.controller.metricsConfig.targetLabels }}
targetLabels :
{{- toYaml . | nindent 8 }}
2021-05-21 12:19:05 +00:00
{{- end }}
namespaceSelector :
matchNames :
2024-03-03 19:12:41 +00:00
- {{ include "argo-workflows.namespace" . | quote }}
2021-05-21 12:19:05 +00:00
selector :
matchLabels :
{{- include "argo-workflows.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }}
{{- end }}