github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/argo-cd/templates/argocd-notifications/servicemonitor.yaml (about)

     1  {{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.notifications.enabled .Values.notifications.metrics.enabled .Values.notifications.metrics.serviceMonitor.enabled }}
     2  apiVersion: monitoring.coreos.com/v1
     3  kind: ServiceMonitor
     4  metadata:
     5    name: {{ template "argo-cd.notifications.fullname" . }}
     6    namespace: {{ default .Release.Namespace .Values.notifications.metrics.serviceMonitor.namespace | quote }}
     7    labels:
     8      {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
     9      {{- with .Values.notifications.metrics.serviceMonitor.selector }}
    10        {{- toYaml . | nindent 4 }}
    11      {{- end }}
    12      {{- if .Values.notifications.metrics.serviceMonitor.additionalLabels }}
    13        {{- toYaml .Values.notifications.metrics.serviceMonitor.additionalLabels | nindent 4 }}
    14      {{- end }}
    15    {{- with .Values.notifications.metrics.serviceMonitor.annotations }}
    16    annotations:
    17      {{- toYaml . | nindent 4 }}
    18    {{- end }}
    19  spec:
    20    endpoints:
    21      - port: {{ .Values.notifications.metrics.service.portName }}
    22        path: /metrics
    23        {{- if .Values.notifications.metrics.serviceMonitor.interval }}
    24        interval: {{ .Values.notifications.metrics.serviceMonitor.interval }}
    25        {{- end }}
    26        {{- if .Values.notifications.metrics.serviceMonitor.scrapeTimeout }}
    27        scrapeTimeout: {{ .Values.notifications.metrics.serviceMonitor.scrapeTimeout }}
    28        {{- end }}
    29        {{- with .Values.notifications.metrics.serviceMonitor.scheme }}
    30        scheme: {{ . }}
    31        {{- end }}
    32        {{- with .Values.notifications.metrics.serviceMonitor.tlsConfig }}
    33        tlsConfig:
    34          {{- toYaml . | nindent 8 }}
    35        {{- end }}
    36        {{- with .Values.notifications.metrics.serviceMonitor.relabelings }}
    37        relabelings:
    38          {{- toYaml . | nindent 8 }}
    39        {{- end }}
    40        {{- with .Values.notifications.metrics.serviceMonitor.metricRelabelings }}
    41        metricRelabelings:
    42          {{- toYaml . | nindent 8 }}
    43        {{- end }}
    44    namespaceSelector:
    45      matchNames:
    46        - {{ .Release.Namespace }}
    47    selector:
    48      matchLabels:
    49        {{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.notifications.name "name" "metrics") | nindent 6 }}
    50  {{- end }}