argocd-helm/charts/argo-cd/templates/argocd-applicationset/servicemonitor.yaml
ericpdurand 3a2858aa98
feat(argo-cd): Adding applicationSet.enable and notifications.enable (#1181)
* feat(argo-cd) Adding applicationSet.enable and notifications.enable to allow to disable them

Signed-off-by: Eric Durand <eric_p_durand@yahoo.com>

* Fixing Chart version and redudant ifs

Signed-off-by: Eric Durand eric_p_durand@yahoo.com
Signed-off-by: Eric Durand <eric_p_durand@yahoo.com>

* Detail the change

Signed-off-by: Eric Durand <eric_p_durand@yahoo.com>

* Drop one more redundant if

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
2022-03-18 17:41:56 +01:00

40 lines
1.5 KiB
YAML

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