argocd-helm/charts/argo-workflows/templates/controller/workflow-controller-servicemonitor.yaml
venegator e718e46651
feat(argo-workflows): Add honorLabels parameter to Argo Workflows ServiceMonitor (#2920)
* Update workflow-controller-servicemonitor.yaml

Signed-off-by: venegator <m.venega94@gmail.com>

* Update values.yaml

Signed-off-by: venegator <m.venega94@gmail.com>

* Update Chart.yaml

Signed-off-by: venegator <m.venega94@gmail.com>

* Update README.md

Signed-off-by: venegator <m.venega94@gmail.com>

* Update charts/argo-workflows/Chart.yaml

Co-authored-by: kiblik <5609770+kiblik@users.noreply.github.com>
Signed-off-by: venegator <m.venega94@gmail.com>

* Update workflow-controller-servicemonitor.yaml

Signed-off-by: venegator <m.venega94@gmail.com>

---------

Signed-off-by: venegator <m.venega94@gmail.com>
Co-authored-by: kiblik <5609770+kiblik@users.noreply.github.com>
2024-09-13 23:01:59 +09:00

53 lines
2.2 KiB
YAML

{{- $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 }}
kind: ServiceMonitor
metadata:
name: {{ template "argo-workflows.controller.fullname" . }}
namespace: {{ default (include "argo-workflows.namespace" .) .Values.controller.serviceMonitor.namespace | quote }}
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 }}
- port: {{ .Values.controller.metricsConfig.servicePortName }}
path: {{ .Values.controller.metricsConfig.path }}
interval: 30s
{{- with .Values.controller.metricsConfig.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.metricsConfig.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
honorLabels: {{ .Values.controller.metricsConfig.honorLabels }}
{{- end }}
{{- if .Values.controller.telemetryConfig.enabled }}
- port: telemetry
path: {{ .Values.controller.telemetryConfig.path }}
interval: 30s
{{- with .Values.controller.metricsConfig.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.metricsConfig.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
honorLabels: {{ .Values.controller.metricsConfig.honorLabels }}
{{- end }}
{{- with .Values.controller.metricsConfig.targetLabels }}
targetLabels:
{{- toYaml . | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ include "argo-workflows.namespace" . | quote }}
selector:
matchLabels:
{{- include "argo-workflows.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }}
{{- end }}