diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 4e2f08701a09..7a25fecdc89c 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -7,7 +7,7 @@ keywords: - prometheus - kubernetes type: application -version: 5.19.0 +version: 5.19.1 appVersion: 2.12.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/servicemonitor.yaml b/charts/kube-state-metrics/templates/servicemonitor.yaml index e2cde649ac5c..99d7fa92464a 100644 --- a/charts/kube-state-metrics/templates/servicemonitor.yaml +++ b/charts/kube-state-metrics/templates/servicemonitor.yaml @@ -40,79 +40,79 @@ spec: {{- end }} endpoints: - port: http - {{- if .Values.prometheus.monitor.interval }} - interval: {{ .Values.prometheus.monitor.interval }} + {{- if or .Values.prometheus.monitor.http.interval .Values.prometheus.monitor.interval }} + interval: {{ .Values.prometheus.monitor.http.interval | default .Values.prometheus.monitor.interval }} {{- end }} - {{- if .Values.prometheus.monitor.scrapeTimeout }} - scrapeTimeout: {{ .Values.prometheus.monitor.scrapeTimeout }} + {{- if or .Values.prometheus.monitor.http.scrapeTimeout .Values.prometheus.monitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.prometheus.monitor.http.scrapeTimeout | default .Values.prometheus.monitor.scrapeTimeout }} {{- end }} - {{- if .Values.prometheus.monitor.proxyUrl }} - proxyUrl: {{ .Values.prometheus.monitor.proxyUrl}} + {{- if or .Values.prometheus.monitor.http.proxyUrl .Values.prometheus.monitor.proxyUrl }} + proxyUrl: {{ .Values.prometheus.monitor.http.proxyUrl | default .Values.prometheus.monitor.proxyUrl }} {{- end }} - {{- if .Values.prometheus.monitor.enableHttp2 }} - enableHttp2: {{ .Values.prometheus.monitor.enableHttp2}} + {{- if or .Values.prometheus.monitor.http.enableHttp2 .Values.prometheus.monitor.enableHttp2 }} + enableHttp2: {{ .Values.prometheus.monitor.http.enableHttp2 | default .Values.prometheus.monitor.enableHttp2 }} {{- end }} - {{- if .Values.prometheus.monitor.honorLabels }} + {{- if or .Values.prometheus.monitor.http.honorLabels .Values.prometheus.monitor.honorLabels }} honorLabels: true {{- end }} - {{- if .Values.prometheus.monitor.metricRelabelings }} + {{- if or .Values.prometheus.monitor.http.metricRelabelings .Values.prometheus.monitor.metricRelabelings }} metricRelabelings: - {{- toYaml .Values.prometheus.monitor.metricRelabelings | nindent 8 }} + {{- toYaml (.Values.prometheus.monitor.http.metricRelabelings | default .Values.prometheus.monitor.metricRelabelings) | nindent 8 }} {{- end }} - {{- if .Values.prometheus.monitor.relabelings }} + {{- if or .Values.prometheus.monitor.http.relabelings .Values.prometheus.monitor.relabelings }} relabelings: - {{- toYaml .Values.prometheus.monitor.relabelings | nindent 8 }} + {{- toYaml (.Values.prometheus.monitor.http.relabelings | default .Values.prometheus.monitor.relabelings) | nindent 8 }} {{- end }} - {{- if .Values.prometheus.monitor.scheme }} - scheme: {{ .Values.prometheus.monitor.scheme }} + {{- if or .Values.prometheus.monitor.http.scheme .Values.prometheus.monitor.scheme }} + scheme: {{ .Values.prometheus.monitor.http.scheme | default .Values.prometheus.monitor.scheme }} {{- end }} - {{- if .Values.prometheus.monitor.tlsConfig }} + {{- if or .Values.prometheus.monitor.http.tlsConfig .Values.prometheus.monitor.tlsConfig }} tlsConfig: - {{- toYaml .Values.prometheus.monitor.tlsConfig | nindent 8 }} + {{- toYaml (.Values.prometheus.monitor.http.tlsConfig | default .Values.prometheus.monitor.tlsConfig) | nindent 8 }} {{- end }} - {{- if .Values.prometheus.monitor.bearerTokenFile }} - bearerTokenFile: {{ .Values.prometheus.monitor.bearerTokenFile }} + {{- if or .Values.prometheus.monitor.http.bearerTokenFile .Values.prometheus.monitor.bearerTokenFile }} + bearerTokenFile: {{ .Values.prometheus.monitor.http.bearerTokenFile | default .Values.prometheus.monitor.bearerTokenFile }} {{- end }} - {{- with .Values.prometheus.monitor.bearerTokenSecret }} + {{- with (.Values.prometheus.monitor.http.bearerTokenSecret | default .Values.prometheus.monitor.bearerTokenSecret) }} bearerTokenSecret: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.selfMonitor.enabled }} - port: metrics - {{- if .Values.prometheus.monitor.interval }} - interval: {{ .Values.prometheus.monitor.interval }} + {{- if or .Values.prometheus.monitor.metrics.interval .Values.prometheus.monitor.interval }} + interval: {{ .Values.prometheus.monitor.metrics.interval | default .Values.prometheus.monitor.interval }} {{- end }} - {{- if .Values.prometheus.monitor.scrapeTimeout }} - scrapeTimeout: {{ .Values.prometheus.monitor.scrapeTimeout }} + {{- if or .Values.prometheus.monitor.metrics.scrapeTimeout .Values.prometheus.monitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.prometheus.monitor.metrics.scrapeTimeout | default .Values.prometheus.monitor.scrapeTimeout }} {{- end }} - {{- if .Values.prometheus.monitor.proxyUrl }} - proxyUrl: {{ .Values.prometheus.monitor.proxyUrl}} + {{- if or .Values.prometheus.monitor.metrics.proxyUrl .Values.prometheus.monitor.proxyUrl }} + proxyUrl: {{ .Values.prometheus.monitor.metrics.proxyUrl | default .Values.prometheus.monitor.proxyUrl }} {{- end }} - {{- if .Values.prometheus.monitor.enableHttp2 }} - enableHttp2: {{ .Values.prometheus.monitor.enableHttp2}} + {{- if or .Values.prometheus.monitor.metrics.enableHttp2 .Values.prometheus.monitor.enableHttp2 }} + enableHttp2: {{ .Values.prometheus.monitor.metrics.enableHttp2 | default .Values.prometheus.monitor.enableHttp2 }} {{- end }} - {{- if .Values.prometheus.monitor.honorLabels }} + {{- if or .Values.prometheus.monitor.metrics.honorLabels .Values.prometheus.monitor.honorLabels }} honorLabels: true {{- end }} - {{- if .Values.prometheus.monitor.metricRelabelings }} + {{- if or .Values.prometheus.monitor.metrics.metricRelabelings .Values.prometheus.monitor.metricRelabelings }} metricRelabelings: - {{- toYaml .Values.prometheus.monitor.metricRelabelings | nindent 8 }} + {{- toYaml (.Values.prometheus.monitor.metrics.metricRelabelings | default .Values.prometheus.monitor.metricRelabelings) | nindent 8 }} {{- end }} - {{- if .Values.prometheus.monitor.relabelings }} + {{- if or .Values.prometheus.monitor.metrics.relabelings .Values.prometheus.monitor.relabelings }} relabelings: - {{- toYaml .Values.prometheus.monitor.relabelings | nindent 8 }} + {{- toYaml (.Values.prometheus.monitor.metrics.relabelings | default .Values.prometheus.monitor.relabelings) | nindent 8 }} {{- end }} - {{- if .Values.prometheus.monitor.scheme }} - scheme: {{ .Values.prometheus.monitor.scheme }} + {{- if or .Values.prometheus.monitor.metrics.scheme .Values.prometheus.monitor.scheme }} + scheme: {{ .Values.prometheus.monitor.metrics.scheme | default .Values.prometheus.monitor.scheme }} {{- end }} - {{- if .Values.prometheus.monitor.tlsConfig }} + {{- if or .Values.prometheus.monitor.metrics.tlsConfig .Values.prometheus.monitor.tlsConfig }} tlsConfig: - {{- toYaml .Values.prometheus.monitor.tlsConfig | nindent 8 }} + {{- toYaml (.Values.prometheus.monitor.metrics.tlsConfig | default .Values.prometheus.monitor.tlsConfig) | nindent 8 }} {{- end }} - {{- if .Values.prometheus.monitor.bearerTokenFile }} - bearerTokenFile: {{ .Values.prometheus.monitor.bearerTokenFile }} + {{- if or .Values.prometheus.monitor.metrics.bearerTokenFile .Values.prometheus.monitor.bearerTokenFile }} + bearerTokenFile: {{ .Values.prometheus.monitor.metrics.bearerTokenFile | default .Values.prometheus.monitor.bearerTokenFile }} {{- end }} - {{- with .Values.prometheus.monitor.bearerTokenSecret }} + {{- with (.Values.prometheus.monitor.metrics.bearerTokenSecret | default .Values.prometheus.monitor.bearerTokenSecret) }} bearerTokenSecret: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 2e8283a89469..bb4fae2c0b52 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -165,7 +165,6 @@ prometheus: jobLabel: "" targetLabels: [] podTargetLabels: [] - interval: "" ## SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. ## sampleLimit: 0 @@ -185,24 +184,49 @@ prometheus: ## Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer. ## labelValueLengthLimit: 0 - scrapeTimeout: "" - proxyUrl: "" - ## Whether to enable HTTP2 for servicemonitor - # enableHttp2: false selectorOverride: {} - honorLabels: false - metricRelabelings: [] - relabelings: [] - scheme: "" - ## File to read bearer token for scraping targets - bearerTokenFile: "" - ## Secret to mount to read bearer token for scraping targets. The secret needs - ## to be in the same namespace as the service monitor and accessible by the - ## Prometheus Operator - bearerTokenSecret: {} - # name: secret-name - # key: key-name - tlsConfig: {} + + ## kube-state-metrics endpoint + http: + interval: "" + scrapeTimeout: "" + proxyUrl: "" + ## Whether to enable HTTP2 for servicemonitor + enableHttp2: false + honorLabels: false + metricRelabelings: [] + relabelings: [] + scheme: "" + ## File to read bearer token for scraping targets + bearerTokenFile: "" + ## Secret to mount to read bearer token for scraping targets. The secret needs + ## to be in the same namespace as the service monitor and accessible by the + ## Prometheus Operator + bearerTokenSecret: {} + # name: secret-name + # key: key-name + tlsConfig: {} + + ## selfMonitor endpoint + metrics: + interval: "" + scrapeTimeout: "" + proxyUrl: "" + ## Whether to enable HTTP2 for servicemonitor + enableHttp2: false + honorLabels: false + metricRelabelings: [] + relabelings: [] + scheme: "" + ## File to read bearer token for scraping targets + bearerTokenFile: "" + ## Secret to mount to read bearer token for scraping targets. The secret needs + ## to be in the same namespace as the service monitor and accessible by the + ## Prometheus Operator + bearerTokenSecret: {} + # name: secret-name + # key: key-name + tlsConfig: {} ## Specify if a Pod Security Policy for kube-state-metrics must be created ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/