github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/thanos/templates/query-frontend/servicemonitor.yaml (about)

     1  {{- if and .Values.queryFrontend.enabled .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) }}
     2  apiVersion: monitoring.coreos.com/v1
     3  kind: ServiceMonitor
     4  metadata:
     5    name: {{ include "common.names.fullname" . }}-query-frontend
     6    namespace: {{ default .Release.Namespace .Values.metrics.serviceMonitor.namespace | quote }}
     7    labels: {{- include "common.labels.standard" . | nindent 4 }}
     8      app.kubernetes.io/component: query-frontend
     9      {{- if .Values.commonLabels }}
    10      {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
    11      {{- end }}
    12      {{- if .Values.metrics.serviceMonitor.labels }}
    13      {{- toYaml .Values.metrics.serviceMonitor.labels | nindent 4 }}
    14      {{- end }}
    15    {{- if .Values.commonAnnotations }}
    16    annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
    17    {{- end }}
    18  spec:
    19    {{- if .Values.metrics.serviceMonitor.jobLabel }}
    20    jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }}
    21    {{- end }}
    22    endpoints:
    23      - port: http
    24        {{- if .Values.verrazzano.isIstioEnabled }}
    25        # If Istio is enabled, specify the certs needed for Prometheus to reach the metrics endpoint
    26        scheme: https
    27        tlsConfig:
    28          caFile: /etc/istio-certs/root-cert.pem
    29          certFile: /etc/istio-certs/cert-chain.pem
    30          keyFile: /etc/istio-certs/key.pem
    31          insecureSkipVerify: true
    32        {{- end}}
    33        {{- if .Values.metrics.serviceMonitor.interval }}
    34        interval: {{ .Values.metrics.serviceMonitor.interval }}
    35        {{- end }}
    36        {{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
    37        scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
    38        {{- end }}
    39        {{- if .Values.metrics.serviceMonitor.metricRelabelings }}
    40        metricRelabelings: {{ toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 8 }}
    41        {{- end }}
    42        {{- if .Values.metrics.serviceMonitor.relabelings }}
    43        relabelings: {{ toYaml .Values.metrics.serviceMonitor.relabelings | nindent 8 }}
    44        {{- end }}
    45    namespaceSelector:
    46      matchNames:
    47        - {{ .Release.Namespace | quote }}
    48    selector:
    49      matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
    50        app.kubernetes.io/component: query-frontend
    51        {{- if .Values.metrics.serviceMonitor.selector }}
    52        {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }}
    53        {{- end }}
    54  {{- end }}