Skip to content

Commit

Permalink
[kube-prometheus-stack] add serviceMonitor.additionalEndpoints (prome…
Browse files Browse the repository at this point in the history
…theus-community#3515)

* add serviceMonitor.additionalEndpoints

Signed-off-by: TheRealNoob <mike1118@live.com>

* [prometheus-json-exporter] defaults and service labels/annotations support (prometheus-community#3865)

* Fixed defaults for annotations from list to dict

Signed-off-by: Aaron Benton<bentonam@gmail.com>
Signed-off-by: Aaron Benton <bentonam@gmail.com>

* Added service labels and annotations

Signed-off-by: Aaron Benton<bentonam@gmail.com>
Signed-off-by: Aaron Benton <bentonam@gmail.com>

* Added ingress labels

Signed-off-by: Aaron Benton<bentonam@gmail.com>
Signed-off-by: Aaron Benton <bentonam@gmail.com>

* Bumped version to 0.7.2

Signed-off-by: Aaron Benton<bentonam@gmail.com>
Signed-off-by: Aaron Benton <bentonam@gmail.com>

---------

Signed-off-by: Aaron Benton<bentonam@gmail.com>
Signed-off-by: Aaron Benton <bentonam@gmail.com>
Signed-off-by: TheRealNoob <mike1118@live.com>

* fix closing if statements

Signed-off-by: TheRealNoob <mike1118@live.com>

* add newlines

Signed-off-by: TheRealNoob <mike1118@live.com>

* fix root reference

Signed-off-by: TheRealNoob <mike1118@live.com>

* [kube-prometheus-stack] Fix IO panels in Cluster Overview (prometheus-community#3902)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: TheRealNoob <mike1118@live.com>

* [kube-prometheus-stack] fix range function in servicemonitors (prometheus-community#3888)

* fix range function to include relabelings and metricRelabelings

Signed-off-by: Christian Niehoff <christian.niehoff@dwpbank.de>

* bump chart version

Signed-off-by: Christian Niehoff <christian.niehoff@dwpbank.de>

---------

Signed-off-by: Christian Niehoff <christian.niehoff@dwpbank.de>
Signed-off-by: TheRealNoob <mike1118@live.com>

* [prometheus-smartctl-exporter] Add relabelings to servicemonitor (prometheus-community#3891)

* [prometheus-smartctl-exporter] Add relabelings to servicemonitor

Signed-off-by: nepomucen <szymon@aus.krakow.pl>

* bump chart version to 0.6.1

Signed-off-by: nepomucen <szymon@aus.krakow.pl>

* Revert "bump chart version to 0.6.1"

This reverts commit 124b85c.

Signed-off-by: nepomucen <szymon@aus.krakow.pl>

* Bump chart's minor version instead of patch version

Signed-off-by: nepomucen <szymon@aus.krakow.pl>

* Use with to control variable scoping

Signed-off-by: nepomucen <szymon@aus.krakow.pl>

---------

Signed-off-by: nepomucen <szymon@aus.krakow.pl>
Signed-off-by: TheRealNoob <mike1118@live.com>

* bump chart version

Signed-off-by: TheRealNoob <mike1118@live.com>

---------

Signed-off-by: TheRealNoob <mike1118@live.com>
Signed-off-by: Aaron Benton<bentonam@gmail.com>
Signed-off-by: Aaron Benton <bentonam@gmail.com>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Christian Niehoff <christian.niehoff@dwpbank.de>
Signed-off-by: nepomucen <szymon@aus.krakow.pl>
Signed-off-by: TheRealNoob <TheRealNoob@users.noreply.github.com>
Co-authored-by: Aaron <bentonam@gmail.com>
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
Co-authored-by: Christian Niehoff <mail@christian-niehoff.com>
Co-authored-by: Szymon Janczy <szymon@aus.krakow.pl>
  • Loading branch information
5 people authored and Matiasmct committed Mar 20, 2024
1 parent 841a0fc commit b6287ef
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 54 deletions.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 51.8.1
version: 51.9.0
appVersion: v0.68.0
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,15 @@ spec:
bearerTokenFile: {{ .Values.alertmanager.serviceMonitor.bearerTokenFile }}
{{- end }}
{{- if .Values.alertmanager.serviceMonitor.tlsConfig }}
tlsConfig: {{ toYaml .Values.alertmanager.serviceMonitor.tlsConfig | nindent 6 }}
tlsConfig: {{- toYaml .Values.alertmanager.serviceMonitor.tlsConfig | nindent 6 }}
{{- end }}
path: "{{ trimSuffix "/" .Values.alertmanager.alertmanagerSpec.routePrefix }}/metrics"
{{- if .Values.alertmanager.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.alertmanager.serviceMonitor.metricRelabelings | indent 6) . }}
{{- end }}
{{- if .Values.alertmanager.serviceMonitor.relabelings }}
relabelings:
{{ toYaml .Values.alertmanager.serviceMonitor.relabelings | indent 6 }}
{{- end }}
{{- if .Values.alertmanager.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- tpl (toYaml .Values.alertmanager.serviceMonitor.metricRelabelings | nindent 6) . }}
{{- end }}
{{- if .Values.alertmanager.serviceMonitor.relabelings }}
relabelings: {{- toYaml .Values.alertmanager.serviceMonitor.relabelings | nindent 6 }}
{{- end }}
- port: reloader-web
{{- if .Values.alertmanager.serviceMonitor.interval }}
interval: {{ .Values.alertmanager.serviceMonitor.interval }}
Expand All @@ -61,15 +59,38 @@ spec:
bearerTokenFile: {{ .Values.alertmanager.serviceMonitor.bearerTokenFile }}
{{- end }}
{{- if .Values.alertmanager.serviceMonitor.tlsConfig }}
tlsConfig: {{ toYaml .Values.alertmanager.serviceMonitor.tlsConfig | nindent 6 }}
tlsConfig: {{- toYaml .Values.alertmanager.serviceMonitor.tlsConfig | nindent 6 }}
{{- end }}
path: "/metrics"
{{- if .Values.alertmanager.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.alertmanager.serviceMonitor.metricRelabelings | indent 6) . }}
{{- end }}
{{- if .Values.alertmanager.serviceMonitor.relabelings }}
relabelings:
{{ toYaml .Values.alertmanager.serviceMonitor.relabelings | indent 6 }}
{{- end }}
{{- if .Values.alertmanager.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- tpl (toYaml .Values.alertmanager.serviceMonitor.metricRelabelings | nindent 6) . }}
{{- end }}
{{- if .Values.alertmanager.serviceMonitor.relabelings }}
relabelings: {{- toYaml .Values.alertmanager.serviceMonitor.relabelings | nindent 6 }}
{{- end }}
{{- range .Values.alertmanager.serviceMonitor.additionalEndpoints }}
- port: {{ .port }}
{{- if or $.Values.alertmanager.serviceMonitor.interval .interval }}
interval: {{ default $.Values.alertmanager.serviceMonitor.interval .interval }}
{{- end }}
{{- if or $.Values.alertmanager.serviceMonitor.proxyUrl .proxyUrl }}
proxyUrl: {{ default $.Values.alertmanager.serviceMonitor.proxyUrl .proxyUrl }}
{{- end }}
{{- if or $.Values.alertmanager.serviceMonitor.scheme .scheme }}
scheme: {{ default $.Values.alertmanager.serviceMonitor.scheme .scheme }}
{{- end }}
{{- if or $.Values.alertmanager.serviceMonitor.bearerTokenFile .bearerTokenFile }}
bearerTokenFile: {{ default $.Values.alertmanager.serviceMonitor.bearerTokenFile .bearerTokenFile }}
{{- end }}
{{- if or $.Values.alertmanager.serviceMonitor.tlsConfig .tlsConfig }}
tlsConfig: {{- default $.Values.alertmanager.serviceMonitor.tlsConfig .tlsConfig | toYaml | nindent 6 }}
{{- end }}
path: {{ .path }}
{{- if or $.Values.alertmanager.serviceMonitor.metricRelabelings .metricRelabelings }}
metricRelabelings: {{- tpl (default $.Values.alertmanager.serviceMonitor.metricRelabelings .metricRelabelings | toYaml | nindent 6) . }}
{{- end }}
{{- if or $.Values.alertmanager.serviceMonitor.relabelings .relabelings }}
relabelings: {{- default $.Values.alertmanager.serviceMonitor.relabelings .relabelings | toYaml | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,18 @@ spec:
scheme: {{ .Values.prometheus.serviceMonitor.scheme }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.tlsConfig }}
tlsConfig: {{ toYaml .Values.prometheus.serviceMonitor.tlsConfig | nindent 6 }}
tlsConfig: {{- toYaml .Values.prometheus.serviceMonitor.tlsConfig | nindent 6 }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.bearerTokenFile }}
bearerTokenFile: {{ .Values.prometheus.serviceMonitor.bearerTokenFile }}
{{- end }}
path: "{{ trimSuffix "/" .Values.prometheus.prometheusSpec.routePrefix }}/metrics"
{{- if .Values.prometheus.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.prometheus.serviceMonitor.metricRelabelings | indent 6) . }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.relabelings }}
relabelings:
{{ toYaml .Values.prometheus.serviceMonitor.relabelings | indent 6 }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- tpl (toYaml .Values.prometheus.serviceMonitor.metricRelabelings | nindent 6) . }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.relabelings }}
relabelings: {{- toYaml .Values.prometheus.serviceMonitor.relabelings | nindent 6 }}
{{- end }}
- port: reloader-web
{{- if .Values.prometheus.serviceMonitor.interval }}
interval: {{ .Values.prometheus.serviceMonitor.interval }}
Expand All @@ -51,18 +49,41 @@ spec:
scheme: {{ .Values.prometheus.serviceMonitor.scheme }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.tlsConfig }}
tlsConfig: {{ toYaml .Values.prometheus.serviceMonitor.tlsConfig | nindent 6 }}
tlsConfig: {{- toYaml .Values.prometheus.serviceMonitor.tlsConfig | nindent 6 }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.bearerTokenFile }}
bearerTokenFile: {{ .Values.prometheus.serviceMonitor.bearerTokenFile }}
{{- end }}
path: "/metrics"
{{- if .Values.prometheus.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.prometheus.serviceMonitor.metricRelabelings | indent 6) . }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.relabelings }}
relabelings:
{{ toYaml .Values.prometheus.serviceMonitor.relabelings | indent 6 }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- tpl (toYaml .Values.prometheus.serviceMonitor.metricRelabelings | nindent 6) . }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.relabelings }}
relabelings: {{- toYaml .Values.prometheus.serviceMonitor.relabelings | nindent 6 }}
{{- end }}
{{- range .Values.prometheus.serviceMonitor.additionalEndpoints }}
- port: {{ .port }}
{{- if or $.Values.prometheus.serviceMonitor.interval .interval }}
interval: {{ default $.Values.prometheus.serviceMonitor.interval .interval }}
{{- end }}
{{- if or $.Values.prometheus.serviceMonitor.proxyUrl .proxyUrl }}
proxyUrl: {{ default $.Values.prometheus.serviceMonitor.proxyUrl .proxyUrl }}
{{- end }}
{{- if or $.Values.prometheus.serviceMonitor.scheme .scheme }}
scheme: {{ default $.Values.prometheus.serviceMonitor.scheme .scheme }}
{{- end }}
{{- if or $.Values.prometheus.serviceMonitor.bearerTokenFile .bearerTokenFile }}
bearerTokenFile: {{ default $.Values.prometheus.serviceMonitor.bearerTokenFile .bearerTokenFile }}
{{- end }}
{{- if or $.Values.prometheus.serviceMonitor.tlsConfig .tlsConfig }}
tlsConfig: {{- default $.Values.prometheus.serviceMonitor.tlsConfig .tlsConfig | toYaml | nindent 6 }}
{{- end }}
path: {{ .path }}
{{- if or $.Values.prometheus.serviceMonitor.metricRelabelings .metricRelabelings }}
metricRelabelings: {{- tpl (default $.Values.prometheus.serviceMonitor.metricRelabelings .metricRelabelings | toYaml | nindent 6) . }}
{{- end }}
{{- if or $.Values.prometheus.serviceMonitor.relabelings .relabelings }}
relabelings: {{- default $.Values.prometheus.serviceMonitor.relabelings .relabelings | toYaml | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,38 @@ spec:
bearerTokenFile: {{ .Values.thanosRuler.serviceMonitor.bearerTokenFile }}
{{- end }}
{{- if .Values.thanosRuler.serviceMonitor.tlsConfig }}
tlsConfig: {{ toYaml .Values.thanosRuler.serviceMonitor.tlsConfig | nindent 6 }}
tlsConfig: {{- toYaml .Values.thanosRuler.serviceMonitor.tlsConfig | nindent 6 }}
{{- end }}
path: "{{ trimSuffix "/" .Values.thanosRuler.thanosRulerSpec.routePrefix }}/metrics"
{{- if .Values.thanosRuler.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.thanosRuler.serviceMonitor.metricRelabelings | indent 6) . }}
{{- end }}
{{- if .Values.thanosRuler.serviceMonitor.relabelings }}
relabelings:
{{ toYaml .Values.thanosRuler.serviceMonitor.relabelings | indent 6 }}
{{- end }}
{{- if .Values.thanosRuler.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- tpl (toYaml .Values.thanosRuler.serviceMonitor.metricRelabelings | nindent 6) . }}
{{- end }}
{{- if .Values.thanosRuler.serviceMonitor.relabelings }}
relabelings: {{- toYaml .Values.thanosRuler.serviceMonitor.relabelings | nindent 6 }}
{{- end }}
{{- range .Values.thanosRuler.serviceMonitor.additionalEndpoints }}
- port: {{ .port }}
{{- if or $.Values.thanosRuler.serviceMonitor.interval .interval }}
interval: {{ default $.Values.thanosRuler.serviceMonitor.interval .interval }}
{{- end }}
{{- if or $.Values.thanosRuler.serviceMonitor.proxyUrl .proxyUrl }}
proxyUrl: {{ default $.Values.thanosRuler.serviceMonitor.proxyUrl .proxyUrl }}
{{- end }}
{{- if or $.Values.thanosRuler.serviceMonitor.scheme .scheme }}
scheme: {{ default $.Values.thanosRuler.serviceMonitor.scheme .scheme }}
{{- end }}
{{- if or $.Values.thanosRuler.serviceMonitor.bearerTokenFile .bearerTokenFile }}
bearerTokenFile: {{ default $.Values.thanosRuler.serviceMonitor.bearerTokenFile .bearerTokenFile }}
{{- end }}
{{- if or $.Values.thanosRuler.serviceMonitor.tlsConfig .tlsConfig }}
tlsConfig: {{- default $.Values.thanosRuler.serviceMonitor.tlsConfig .tlsConfig | toYaml | nindent 6 }}
{{- end }}
path: {{ .path }}
{{- if or $.Values.thanosRuler.serviceMonitor.metricRelabelings .metricRelabelings }}
metricRelabelings: {{- tpl (default $.Values.thanosRuler.serviceMonitor.metricRelabelings .metricRelabelings | toYaml | nindent 6) . }}
{{- end }}
{{- if or $.Values.thanosRuler.serviceMonitor.relabelings .relabelings }}
relabelings: {{- default $.Values.thanosRuler.serviceMonitor.relabelings .relabelings | toYaml | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
49 changes: 41 additions & 8 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,14 @@ alertmanager:
##

## Additional ports to open for Alertmanager service
##
additionalPorts: []
# additionalPorts:
# - name: authenticated
# - name: oauth-proxy
# port: 8081
# targetPort: 8081
# - name: oauth-metrics
# port: 8082
# targetPort: 8082

externalIPs: []
loadBalancerIP: ""
Expand Down Expand Up @@ -584,6 +587,12 @@ alertmanager:
# replacement: $1
# action: replace

## Additional Endpoints
##
additionalEndpoints: []
# - port: oauth-metrics
# path: /metrics

## Settings affecting alertmanagerSpec
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#alertmanagerspec
##
Expand Down Expand Up @@ -806,15 +815,19 @@ alertmanager:
containers: []
# containers:
# - name: oauth-proxy
# image: quay.io/oauth2-proxy/oauth2-proxy:v7.3.0
# image: quay.io/oauth2-proxy/oauth2-proxy:v7.5.1
# args:
# - --upstream=http://127.0.0.1:9093
# - --http-address=0.0.0.0:8081
# - --metrics-address=0.0.0.0:8082
# - ...
# ports:
# - containerPort: 8081
# name: oauth-proxy
# protocol: TCP
# - containerPort: 8082
# name: oauth-metrics
# protocol: TCP
# resources: {}

# Additional volumes on the output StatefulSet definition.
Expand Down Expand Up @@ -2153,7 +2166,7 @@ prometheusOperator:

nodePortTls: 30443

## Additional ports to open for Prometheus service
## Additional ports to open for Prometheus operator service
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#multi-port-services
##
additionalPorts: []
Expand Down Expand Up @@ -2613,12 +2626,16 @@ prometheus:
##
type: ClusterIP

## Additional port to define in the Service
## Additional ports to open for Prometheus service
##
additionalPorts: []
# additionalPorts:
# - name: authenticated
# - name: oauth-proxy
# port: 8081
# targetPort: 8081
# - name: oauth-metrics
# port: 8082
# targetPort: 8082

## Consider that all endpoints are considered "ready" even if the Pods themselves are not
## Ref: https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/#ServiceSpec
Expand Down Expand Up @@ -2861,6 +2878,12 @@ prometheus:
# replacement: $1
# action: replace

## Additional Endpoints
##
additionalEndpoints: []
# - port: oauth-metrics
# path: /metrics

## Settings affecting prometheusSpec
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#prometheusspec
##
Expand Down Expand Up @@ -3414,15 +3437,19 @@ prometheus:
containers: []
# containers:
# - name: oauth-proxy
# image: quay.io/oauth2-proxy/oauth2-proxy:v7.3.0
# image: quay.io/oauth2-proxy/oauth2-proxy:v7.5.1
# args:
# - --upstream=http://127.0.0.1:9093
# - --upstream=http://127.0.0.1:9090
# - --http-address=0.0.0.0:8081
# - --metrics-address=0.0.0.0:8082
# - ...
# ports:
# - containerPort: 8081
# name: oauth-proxy
# protocol: TCP
# - containerPort: 8082
# name: oauth-metrics
# protocol: TCP
# resources: {}

## InitContainers allows injecting additional initContainers. This is meant to allow doing some changes
Expand Down Expand Up @@ -3844,6 +3871,12 @@ thanosRuler:
# replacement: $1
# action: replace

## Additional Endpoints
##
additionalEndpoints: []
# - port: oauth-metrics
# path: /metrics

## Settings affecting thanosRulerpec
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosrulerspec
##
Expand Down

0 comments on commit b6287ef

Please sign in to comment.