|
| 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 | + {{- include "scrapeconfig.scrapeLimits" .Values.prometheus.scrapeconfig | indent 2 }} |
| 18 | + staticConfigs: |
| 19 | + - targets: |
| 20 | + - {{ template "kube-state-metrics.fullname" . }}.{{ template "kube-state-metrics.namespace" . }}.svc:{{ .Values.service.port }} |
| 21 | + {{- if .Values.prometheus.scrapeconfig.staticConfigLabels}} |
| 22 | + labels: |
| 23 | + {{- with .Values.prometheus.scrapeconfig.staticConfigLabels }} |
| 24 | + {{- tpl (toYaml . | nindent 8) $ }} |
| 25 | + {{- end }} |
| 26 | + {{- end }} |
| 27 | +{{- if .Values.prometheus.scrapeconfig.jobName }} |
| 28 | + jobName: {{ .Values.prometheus.scrapeconfig.jobName }} |
| 29 | +{{- end }} |
| 30 | +{{- if .Values.prometheus.scrapeconfig.honorLabels }} |
| 31 | + honorLabels: true |
| 32 | +{{- end }} |
| 33 | +{{- if .Values.prometheus.scrapeconfig.scrapeInterval }} |
| 34 | + scrapeInterval: {{ .Values.prometheus.scrapeconfig.scrapeInterval }} |
| 35 | +{{- end }} |
| 36 | +{{- if .Values.prometheus.scrapeconfig.scrapeTimeout }} |
| 37 | + scrapeTimeout: {{ .Values.prometheus.scrapeconfig.scrapeTimeout }} |
| 38 | +{{- end }} |
| 39 | +{{- if .Values.prometheus.scrapeconfig.proxyUrl }} |
| 40 | + proxyUrl: {{ .Values.prometheus.scrapeconfig.proxyUrl }} |
| 41 | +{{- end }} |
| 42 | +{{- if .Values.prometheus.scrapeconfig.enableHttp2 }} |
| 43 | + enableHttp2: {{ .Values.prometheus.scrapeconfig.enableHttp2 }} |
| 44 | +{{- end }} |
| 45 | +{{- if .Values.prometheus.scrapeconfig.metricRelabelings }} |
| 46 | + metricRelabelings: |
| 47 | + {{- toYaml .Values.prometheus.scrapeconfig.metricRelabelings | nindent 4 }} |
| 48 | +{{- end }} |
| 49 | +{{- if .Values.prometheus.scrapeconfig.relabelings }} |
| 50 | + relabelings: |
| 51 | + {{- toYaml .Values.prometheus.scrapeconfig.relabelings | nindent 4 }} |
| 52 | +{{- end }} |
| 53 | +{{- if .Values.prometheus.scrapeconfig.scheme }} |
| 54 | + scheme: {{ .Values.prometheus.scrapeconfig.scheme }} |
| 55 | +{{- end }} |
| 56 | +{{- if .Values.prometheus.scrapeconfig.tlsConfig }} |
| 57 | + tlsConfig: |
| 58 | + {{- toYaml (.Values.prometheus.scrapeconfig.tlsConfig ) | nindent 4 }} |
| 59 | +{{- end }} |
| 60 | +{{- end }} |
0 commit comments