sigs.k8s.io/external-dns@v0.14.1/charts/external-dns/templates/servicemonitor.yaml (about)

     1  {{- if .Values.serviceMonitor.enabled -}}
     2  {{- $providerName := include "external-dns.providerName" . }}
     3  apiVersion: monitoring.coreos.com/v1
     4  kind: ServiceMonitor
     5  metadata:
     6    name: {{ include "external-dns.fullname" . }}
     7    namespace: {{ default .Release.Namespace .Values.serviceMonitor.namespace }}
     8    {{- with .Values.serviceMonitor.annotations }}
     9    annotations:
    10      {{- toYaml . | nindent 4 }}
    11    {{- end }}
    12    labels:
    13      {{- include "external-dns.labels" . | nindent 4 }}
    14    {{- with .Values.serviceMonitor.additionalLabels }}
    15      {{- toYaml . | nindent 4 }}
    16    {{- end }}
    17  spec:
    18    jobLabel: {{ .Release.Name }}
    19    namespaceSelector:
    20      matchNames:
    21        - {{ .Release.Namespace }}
    22    selector:
    23      matchLabels:
    24        {{- include "external-dns.selectorLabels" . | nindent 6 }}
    25    endpoints:
    26      - port: http
    27        path: /metrics
    28        {{- with .Values.serviceMonitor.interval }}
    29        interval: {{ . }}
    30        {{- end }}
    31        {{- with .Values.serviceMonitor.scheme }}
    32        scheme: {{ . }}
    33        {{- end }}
    34        {{- with .Values.serviceMonitor.bearerTokenFile }}
    35        bearerTokenFile: {{ . }}
    36        {{- end }}
    37        {{- with .Values.serviceMonitor.tlsConfig }}
    38        tlsConfig:
    39          {{- toYaml .| nindent 8 }}
    40        {{- end }}
    41        {{- with .Values.serviceMonitor.scrapeTimeout }}
    42        scrapeTimeout: {{ . }}
    43        {{- end }}
    44        {{- with .Values.serviceMonitor.metricRelabelings }}
    45        metricRelabelings:
    46          {{- toYaml . | nindent 8 }}
    47        {{- end }}
    48        {{- with .Values.serviceMonitor.relabelings }}
    49        relabelings:
    50          {{- toYaml . | nindent 8 }}
    51        {{- end }}
    52      {{- if eq $providerName "webhook" }}
    53      {{- with .Values.provider.webhook.serviceMonitor }}
    54      - port: webhook-metrics
    55        path: /metrics
    56        {{- with .interval }}
    57        interval: {{ . }}
    58        {{- end }}
    59        {{- with .scheme }}
    60        scheme: {{ . }}
    61        {{- end }}
    62        {{- with .bearerTokenFile }}
    63        bearerTokenFile: {{ . }}
    64        {{- end }}
    65        {{- with .tlsConfig }}
    66        tlsConfig:
    67          {{- toYaml .| nindent 8 }}
    68        {{- end }}
    69        {{- with .scrapeTimeout }}
    70        scrapeTimeout: {{ . }}
    71        {{- end }}
    72        {{- with .metricRelabelings }}
    73        metricRelabelings:
    74          {{- toYaml . | nindent 8 }}
    75        {{- end }}
    76        {{- with .relabelings }}
    77        relabelings:
    78          {{- toYaml . | nindent 8 }}
    79        {{- end }}
    80      {{- end }}
    81      {{- end }}
    82    {{- with .Values.serviceMonitor.targetLabels }}
    83    targetLabels:
    84      {{- toYaml . | nindent 4 }}
    85    {{- end }}
    86  {{- end }}