github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/prometheus-community/kube-state-metrics/templates/servicemonitor.yaml (about)

     1  {{- if .Values.prometheus.monitor.enabled }}
     2  apiVersion: monitoring.coreos.com/v1
     3  kind: ServiceMonitor
     4  metadata:
     5    name: {{ template "kube-state-metrics.fullname" . }}
     6    namespace: {{ template "kube-state-metrics.namespace" . }}
     7    labels:
     8      {{- include "kube-state-metrics.labels" . | indent 4 }}
     9    {{- with .Values.prometheus.monitor.additionalLabels }}
    10      {{- toYaml . | nindent 4 }}
    11    {{- end }}
    12    {{- with .Values.prometheus.monitor.annotations }}
    13    annotations:
    14      {{- toYaml . | nindent 4 }}
    15    {{- end }}
    16  spec:
    17    jobLabel: {{ default "app.kubernetes.io/name" .Values.prometheus.monitor.jobLabel }}
    18    {{- with .Values.prometheus.monitor.targetLabels }}
    19    targetLabels:
    20      {{- toYaml . | trim | nindent 4 }}
    21    {{- end }}
    22    {{- with .Values.prometheus.monitor.podTargetLabels }}
    23    podTargetLabels:
    24      {{- toYaml . | trim | nindent 4 }}
    25    {{- end }}
    26    {{- include "servicemonitor.scrapeLimits" .Values.prometheus.monitor | indent 2 }}
    27    {{- if .Values.prometheus.monitor.namespaceSelector }}
    28    namespaceSelector:
    29      matchNames:
    30      {{- with .Values.prometheus.monitor.namespaceSelector }}
    31        {{- toYaml . | nindent 6 }}
    32      {{- end }}
    33    {{- end }}
    34    selector:
    35      matchLabels:
    36      {{- with .Values.prometheus.monitor.selectorOverride }}
    37        {{- toYaml . | nindent 6 }}
    38      {{- else }}
    39        {{- include "kube-state-metrics.selectorLabels" . | indent 6 }}
    40      {{- end }}
    41    endpoints:
    42      - port: http
    43      {{- if .Values.prometheus.monitor.interval }}
    44        interval: {{ .Values.prometheus.monitor.interval }}
    45      {{- end }}
    46      {{- if .Values.prometheus.monitor.scrapeTimeout }}
    47        scrapeTimeout: {{ .Values.prometheus.monitor.scrapeTimeout }}
    48      {{- end }}
    49      {{- if .Values.prometheus.monitor.proxyUrl }}
    50        proxyUrl: {{ .Values.prometheus.monitor.proxyUrl}}
    51      {{- end }}
    52      {{- if .Values.prometheus.monitor.honorLabels }}
    53        honorLabels: true
    54      {{- end }}
    55      {{- if .Values.prometheus.monitor.metricRelabelings }}
    56        metricRelabelings:
    57          {{- toYaml .Values.prometheus.monitor.metricRelabelings | nindent 8 }}
    58      {{- end }}
    59      {{- if .Values.prometheus.monitor.relabelings }}
    60        relabelings:
    61          {{- toYaml .Values.prometheus.monitor.relabelings | nindent 8 }}
    62      {{- end }}
    63      {{- if .Values.prometheus.monitor.scheme }}
    64        scheme: {{ .Values.prometheus.monitor.scheme }}
    65      {{- end }}
    66      {{- if .Values.prometheus.monitor.tlsConfig }}
    67        tlsConfig:
    68          {{- toYaml .Values.prometheus.monitor.tlsConfig | nindent 8 }}
    69      {{- end }}
    70      {{- if .Values.prometheus.monitor.bearerTokenFile }}
    71        bearerTokenFile: {{ .Values.prometheus.monitor.bearerTokenFile }}
    72      {{- end }}
    73      {{- with .Values.prometheus.monitor.bearerTokenSecret }}
    74        bearerTokenSecret:
    75          {{- toYaml . | nindent 8 }}
    76      {{- end }}
    77    {{- if .Values.selfMonitor.enabled }}
    78      - port: metrics
    79      {{- if .Values.prometheus.monitor.interval }}
    80        interval: {{ .Values.prometheus.monitor.interval }}
    81      {{- end }}
    82      {{- if .Values.prometheus.monitor.scrapeTimeout }}
    83        scrapeTimeout: {{ .Values.prometheus.monitor.scrapeTimeout }}
    84      {{- end }}
    85      {{- if .Values.prometheus.monitor.proxyUrl }}
    86        proxyUrl: {{ .Values.prometheus.monitor.proxyUrl}}
    87      {{- end }}
    88      {{- if .Values.prometheus.monitor.honorLabels }}
    89        honorLabels: true
    90      {{- end }}
    91      {{- if .Values.prometheus.monitor.metricRelabelings }}
    92        metricRelabelings:
    93          {{- toYaml .Values.prometheus.monitor.metricRelabelings | nindent 8 }}
    94      {{- end }}
    95      {{- if .Values.prometheus.monitor.relabelings }}
    96        relabelings:
    97          {{- toYaml .Values.prometheus.monitor.relabelings | nindent 8 }}
    98      {{- end }}
    99      {{- if .Values.prometheus.monitor.scheme }}
   100        scheme: {{ .Values.prometheus.monitor.scheme }}
   101      {{- end }}
   102      {{- if .Values.prometheus.monitor.tlsConfig }}
   103        tlsConfig:
   104          {{- toYaml .Values.prometheus.monitor.tlsConfig | nindent 8 }}
   105      {{- end }}
   106      {{- if .Values.prometheus.monitor.bearerTokenFile }}
   107        bearerTokenFile: {{ .Values.prometheus.monitor.bearerTokenFile }}
   108      {{- end }}
   109      {{- with .Values.prometheus.monitor.bearerTokenSecret }}
   110        bearerTokenSecret:
   111          {{- toYaml . | nindent 8 }}
   112      {{- end }}
   113    {{- end }}
   114  {{- end }}