From 5dcc890bbb5cb1d8c952835067332e39efec0ca4 Mon Sep 17 00:00:00 2001 From: johgoe Date: Tue, 9 Jul 2024 16:47:42 +0200 Subject: [PATCH] [kube-prometheus-stack] Add scrapeClasses to prometheus resource (#4685) (#4703) --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../templates/prometheus/prometheus.yaml | 4 ++++ charts/kube-prometheus-stack/values.yaml | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 5d30417dc9d6..45f8a92cc603 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -23,7 +23,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 61.2.0 +version: 61.3.0 appVersion: v0.75.0 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/prometheus/prometheus.yaml b/charts/kube-prometheus-stack/templates/prometheus/prometheus.yaml index a40cb0ef7a66..fd65a8e055f4 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/prometheus.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/prometheus.yaml @@ -112,6 +112,10 @@ spec: - {{ tpl $enableFeatures $ }} {{- end }} {{- end }} +{{- with .Values.prometheus.prometheusSpec.scrapeClasses }} + scrapeClasses: + {{- tpl (toYaml . | nindent 4) $ }} +{{- end }} {{- if .Values.prometheus.prometheusSpec.scrapeInterval }} scrapeInterval: {{ .Values.prometheus.prometheusSpec.scrapeInterval }} {{- end }} diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index ee5a65934d28..552e91d12473 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -3408,6 +3408,16 @@ prometheus: ## scrapeTimeout: "" + ## List of scrape classes to expose to scraping objects such as + ## PodMonitors, ServiceMonitors, Probes and ScrapeConfigs. + ## + scrapeClasses: [] + # - name: istio-mtls + # default: false + # tlsConfig: + # caFile: /etc/prometheus/secrets/istio.default/root-cert.pem + # certFile: /etc/prometheus/secrets/istio.default/cert-chain.pem + ## Interval between consecutive evaluations. ## evaluationInterval: ""