argocd-helm/charts/argo-cd/templates/argocd-application-controller/servicemonitor.yaml
Alex Souslik c2f813ec62
feat(argo-cd): make ServiceMonitor deployment conditional on CRD existence (#2154)
* made ServiceMonitor deployment conditional on CRD existence

Signed-off-by: alex-souslik-hs <alex.s@hiredscore.com>

* remove non ArgoCD changes

Signed-off-by: alex-souslik-hs <alex.s@hiredscore.com>

* add newline

Signed-off-by: Alex Souslik <alex.s@hiredscore.com>

* Change chage description

Signed-off-by: Alex Souslik <alex.s@hiredscore.com>

* Update charts/argo-cd/Chart.yaml

Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
Signed-off-by: Alex Souslik <alex.s@hiredscore.com>

---------

Signed-off-by: alex-souslik-hs <alex.s@hiredscore.com>
Signed-off-by: Alex Souslik <alex.s@hiredscore.com>
Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
2023-07-18 08:51:14 +02:00

47 lines
1.9 KiB
YAML

{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.controller.metrics.enabled .Values.controller.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "argo-cd.controller.fullname" . }}
namespace: {{ default .Release.Namespace .Values.controller.metrics.serviceMonitor.namespace | quote }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- with .Values.controller.metrics.serviceMonitor.selector }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.controller.metrics.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.controller.metrics.serviceMonitor.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: {{ .Values.controller.metrics.service.portName }}
{{- with .Values.controller.metrics.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
path: /metrics
{{- with .Values.controller.metrics.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.metrics.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.metrics.serviceMonitor.scheme }}
scheme: {{ . }}
{{- end }}
{{- with .Values.controller.metrics.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.controller.name "name" "metrics") | nindent 6 }}
{{- end }}