argocd-helm/charts/argo-cd/templates/argocd-notifications/servicemonitor.yaml
Christian Brauchli 57e1cd6960
feat(argo-cd): Make metrics and serviceMonitors usable on an istio service mesh (#1270)
* feat(argo-cd): Make metrics and serviceMonitors usable on an istio service mesh

Signed-off-by: Christian Brauchli <chb@open.ch>

* change back default values

Signed-off-by: Christian Brauchli <chb@open.ch>

* update README

Signed-off-by: Christian Brauchli <chb@open.ch>

* change values to the values they where before

Signed-off-by: Christian Brauchli <chb@open.ch>

* fix lint

Signed-off-by: Christian Brauchli <chb@open.ch>

* adjust default portName to be istio compatible

Signed-off-by: Christian Brauchli <chb@open.ch>

* update docs

Signed-off-by: Christian Brauchli <chb@open.ch>

* Resolve copy-paste errors

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

* Restore dex/deployment.yaml and adapt dex/service.yaml

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

* Bump minor chart version and add port renaming to changelog

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

Co-authored-by: Christian Brauchli <chb@open.ch>
Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
2022-05-10 09:40:49 +02:00

40 lines
1.8 KiB
YAML

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