|
| 1 | +{{- if .Values.prometheus.scrapeconfig.enabled }} |
| 2 | +apiVersion: monitoring.coreos.com/v1alpha1 |
| 3 | +kind: ScrapeConfig |
| 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.scrapeconfig.additionalLabels }} |
| 10 | + {{- tpl (toYaml . | nindent 4) $ }} |
| 11 | + {{- end }} |
| 12 | + {{- with .Values.prometheus.scrapeconfig.annotations }} |
| 13 | + annotations: |
| 14 | + {{- tpl (toYaml . | nindent 4) $ }} |
| 15 | + {{- end }} |
| 16 | +spec: |
| 17 | + jobName: {{ default "app.kubernetes.io/name" .Values.prometheus.scrapeconfig.jobLabel }} |
| 18 | + {{- include "scrapeconfig.scrapeLimits" .Values.prometheus.scrapeconfig | indent 2 }} |
| 19 | + staticConfigs: |
| 20 | + - targets: |
| 21 | + - {{ template "kube-state-metrics.fullname" . }}.{{ template "kube-state-metrics.namespace" . }}.svc:{{ .Values.service.port }} |
| 22 | + labels: |
| 23 | + {{- with .Values.prometheus.scrapeconfig.staticConfigLabels }} |
| 24 | + {{- tpl (toYaml . | nindent 8) $ }} |
| 25 | + {{- end }} |
| 26 | + {{- if .Values.prometheus.scrapeconfig.honorLabels }} |
| 27 | + honorLabels: true |
| 28 | + {{- end }} |
| 29 | + {{- if .Values.prometheus.scrapeconfig.scrapeInterval }} |
| 30 | + scrapeInterval: {{ .Values.prometheus.scrapeconfig.scrapeInterval }} |
| 31 | + {{- end }} |
| 32 | + {{- if .Values.prometheus.scrapeconfig.scrapeTimeout }} |
| 33 | + scrapeTimeout: {{ .Values.prometheus.scrapeconfig.scrapeTimeout }} |
| 34 | + {{- end }} |
| 35 | + {{- if .Values.prometheus.scrapeconfig.proxyUrl }} |
| 36 | + proxyUrl: {{ .Values.prometheus.scrapeconfig.proxyUrl }} |
| 37 | + {{- end }} |
| 38 | + {{- if .Values.prometheus.scrapeconfig.enableHttp2 }} |
| 39 | + enableHttp2: {{ .Values.prometheus.scrapeconfig.enableHttp2 }} |
| 40 | + {{- end }} |
| 41 | + {{- if .Values.prometheus.scrapeconfig.metricRelabelings }} |
| 42 | + metricRelabelings: |
| 43 | + {{- toYaml (.Values.prometheus.scrapeconfig.metricRelabelings | nindent 4 }} |
| 44 | + {{- end }} |
| 45 | + {{- if .Values.prometheus.scrapeconfig.relabelings }} |
| 46 | + relabelings: |
| 47 | + {{- toYaml (.Values.prometheus.scrapeconfig.relabelings ) | nindent 4 }} |
| 48 | + {{- end }} |
| 49 | + {{- if or .Values.prometheus.scrapeconfig.scheme }} |
| 50 | + scheme: {{ .Values.prometheus.scrapeconfig.scheme }} |
| 51 | + {{- end }} |
| 52 | + {{- if .Values.prometheus.scrapeconfig.tlsConfig }} |
| 53 | + tlsConfig: |
| 54 | + {{- toYaml (.Values.prometheus.scrapeconfig.tlsConfig ) | nindent 4 }} |
| 55 | + {{- end }} |
| 56 | +{{- end }} |
0 commit comments