Skip to content

Commit 0288864

Browse files
Merge branch 'main' into feat/alertmanager-custom-namespace
2 parents 907f8a7 + ed7cf08 commit 0288864

22 files changed

+260
-38
lines changed

Diff for: charts/kube-state-metrics/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords:
77
- prometheus
88
- kubernetes
99
type: application
10-
version: 5.31.1
10+
version: 5.32.0
1111
# renovate: github-releases=kubernetes/kube-state-metrics
1212
appVersion: 2.15.0
1313
home: https://github.com/kubernetes/kube-state-metrics/

Diff for: charts/kube-state-metrics/templates/_helpers.tpl

+19
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ labelValueLengthLimit: {{ . }}
104104
{{- end }}
105105
{{- end -}}
106106

107+
{{/* Sets default scrape limits for scrapeconfig */}}
108+
{{- define "scrapeconfig.scrapeLimits" -}}
109+
{{- with .sampleLimit }}
110+
sampleLimit: {{ . }}
111+
{{- end }}
112+
{{- with .targetLimit }}
113+
targetLimit: {{ . }}
114+
{{- end }}
115+
{{- with .labelLimit }}
116+
labelLimit: {{ . }}
117+
{{- end }}
118+
{{- with .labelNameLengthLimit }}
119+
labelNameLengthLimit: {{ . }}
120+
{{- end }}
121+
{{- with .labelValueLengthLimit }}
122+
labelValueLengthLimit: {{ . }}
123+
{{- end }}
124+
{{- end -}}
125+
107126
{{/*
108127
Formats imagePullSecrets. Input is (dict "Values" .Values "imagePullSecrets" .{specific imagePullSecrets})
109128
*/}}

Diff for: charts/kube-state-metrics/templates/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ spec:
5252
initContainers:
5353
{{- toYaml . | nindent 6 }}
5454
{{- end }}
55+
{{- if .Values.dnsConfig }}
56+
dnsConfig: {{ toYaml .Values.dnsConfig | nindent 8 }}
57+
{{- end }}
58+
dnsPolicy: {{ .Values.dnsPolicy }}
5559
containers:
5660
{{- $servicePort := ternary 9090 (.Values.service.port | default 8080) .Values.kubeRBACProxy.enabled}}
5761
{{- $telemetryPort := ternary 9091 (.Values.selfMonitor.telemetryPort | default 8081) .Values.kubeRBACProxy.enabled}}
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 }}

Diff for: charts/kube-state-metrics/values.yaml

+48
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,46 @@ prometheus:
239239
# name: secret-name
240240
# key: key-name
241241
tlsConfig: {}
242+
## Create a scrapeConfig resource for scraping the kube-state-metrics service. Use this instead of serviceMonitor
243+
## to have more instances of kube-state-metrics safety.
244+
scrapeconfig:
245+
## To avoid duplicate metrics, first disable the serviceMonitor creation via prometheus.monitor.enabled=false
246+
enabled: false
247+
annotations: {}
248+
additionalLabels: {}
249+
jobName: kube-state-metrics
250+
## SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
251+
##
252+
sampleLimit: 0
253+
254+
## TargetLimit defines a limit on the number of scraped targets that will be accepted.
255+
##
256+
targetLimit: 0
257+
258+
## Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
259+
##
260+
labelLimit: 0
261+
262+
## Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
263+
##
264+
labelNameLengthLimit: 0
265+
266+
## 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.
267+
##
268+
labelValueLengthLimit: 0
269+
270+
## StaticConfigLabels defines the labels to be used in the Prometheus static configuration for scraping.
271+
staticConfigLabels: {}
272+
scrapeInterval: ""
273+
scrapeTimeout: ""
274+
proxyUrl: ""
275+
## Whether to enable HTTP2 for scrapeconfig
276+
enableHttp2: false
277+
honorLabels: true
278+
metricRelabelings: []
279+
relabelings: []
280+
scheme: ""
281+
tlsConfig: {}
242282

243283
## Specify if a Pod Security Policy for kube-state-metrics must be created
244284
## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
@@ -519,6 +559,14 @@ initContainers: []
519559
# - name: crd-sidecar
520560
# image: kiwigrid/k8s-sidecar:latest
521561

562+
## dnsPolicy allows to change the default DNS configuration for the pod
563+
## Ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy
564+
dnsPolicy: ClusterFirst
565+
566+
## dnsConfig allows setting up specific DNS configuration for the pod
567+
## Ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config
568+
dnsConfig: {}
569+
522570
## Settings for startup, liveness and readiness probes
523571
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
524572
##

Diff for: charts/prometheus-adapter/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v1
22
name: prometheus-adapter
3-
version: 4.13.0
3+
version: 4.14.1
44
appVersion: v0.12.0
55
description: A Helm chart for k8s prometheus adapter
66
home: https://github.com/kubernetes-sigs/prometheus-adapter

Diff for: charts/prometheus-adapter/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ rules:
136136
containerLabel: container
137137
memory:
138138
containerQuery: |
139-
sum by (<<.GroupBy>>) (
139+
round(sum by (<<.GroupBy>>) (
140140
avg_over_time(container_memory_working_set_bytes{container!="",<<.LabelMatchers>>}[3m])
141-
)
141+
))
142142
nodeQuery: |
143-
sum by (<<.GroupBy>>) (
143+
round(sum by (<<.GroupBy>>) (
144144
avg_over_time(node_memory_MemTotal_bytes{<<.LabelMatchers>>}[3m])
145145
-
146146
avg_over_time(node_memory_MemAvailable_bytes{<<.LabelMatchers>>}[3m])
147-
)
147+
))
148148
resources:
149149
overrides:
150150
node:
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{ range .Values.extraManifests }}
2+
---
3+
{{ tpl (toYaml .) $ }}
4+
{{ end }}

Diff for: charts/prometheus-adapter/values.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,13 @@ certManager:
302302
# Defaults to nil.
303303
caCertRevisionHistoryLimit:
304304
certRevisionHistoryLimit:
305+
306+
## Extra manifests to deploy as an array
307+
extraManifests: []
308+
# - apiVersion: v1
309+
# kind: ConfigMap
310+
# metadata:
311+
# labels:
312+
# name: prometheus-extra
313+
# data:
314+
# extra-data: "value"

Diff for: charts/prometheus-operator-crds/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
type: application
3-
version: 19.0.0
3+
version: 19.1.0
44
name: prometheus-operator-crds
55
icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/assets/prometheus_logo-cb55bb5c346.png
66
description: |

Diff for: charts/prometheus-operator-crds/charts/crds/templates/crd-alertmanagerconfigs.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.alertmanagerconfigs.enabled -}}
12
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -10039,3 +10040,4 @@ spec:
1003910040
type: object
1004010041
served: true
1004110042
storage: true
10043+
{{- end -}}

Diff for: charts/prometheus-operator-crds/charts/crds/templates/crd-alertmanagers.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.alertmanagers.enabled -}}
12
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -9134,3 +9135,4 @@ spec:
91349135
specReplicasPath: .spec.replicas
91359136
statusReplicasPath: .status.replicas
91369137
status: {}
9138+
{{- end -}}

Diff for: charts/prometheus-operator-crds/charts/crds/templates/crd-podmonitors.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.podmonitors.enabled -}}
12
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -1209,3 +1210,4 @@ spec:
12091210
type: object
12101211
served: true
12111212
storage: true
1213+
{{- end -}}

Diff for: charts/prometheus-operator-crds/charts/crds/templates/crd-probes.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.probes.enabled -}}
12
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -1176,3 +1177,4 @@ spec:
11761177
type: object
11771178
served: true
11781179
storage: true
1180+
{{- end -}}

Diff for: charts/prometheus-operator-crds/charts/crds/templates/crd-prometheusagents.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.prometheusagents.enabled -}}
12
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusagents.yaml
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -10839,3 +10840,4 @@ spec:
1083910840
specReplicasPath: .spec.shards
1084010841
statusReplicasPath: .status.shards
1084110842
status: {}
10843+
{{- end -}}

Diff for: charts/prometheus-operator-crds/charts/crds/templates/crd-prometheuses.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.prometheuses.enabled -}}
12
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -13090,3 +13091,4 @@ spec:
1309013091
specReplicasPath: .spec.shards
1309113092
statusReplicasPath: .status.shards
1309213093
status: {}
13094+
{{- end -}}

Diff for: charts/prometheus-operator-crds/charts/crds/templates/crd-prometheusrules.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.prometheusrules.enabled -}}
12
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -161,3 +162,4 @@ spec:
161162
type: object
162163
served: true
163164
storage: true
165+
{{- end -}}

Diff for: charts/prometheus-operator-crds/charts/crds/templates/crd-scrapeconfigs.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.scrapeconfigs.enabled -}}
12
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_scrapeconfigs.yaml
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -12516,3 +12517,4 @@ spec:
1251612517
type: object
1251712518
served: true
1251812519
storage: true
12520+
{{- end -}}

Diff for: charts/prometheus-operator-crds/charts/crds/templates/crd-servicemonitors.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.servicemonitors.enabled -}}
12
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -1231,3 +1232,4 @@ spec:
12311232
type: object
12321233
served: true
12331234
storage: true
1235+
{{- end -}}

Diff for: charts/prometheus-operator-crds/charts/crds/templates/crd-thanosrulers.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.thanosrulers.enabled -}}
12
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -8155,3 +8156,4 @@ spec:
81558156
storage: true
81568157
subresources:
81578158
status: {}
8159+
{{- end -}}

0 commit comments

Comments
 (0)