From 7215580f3f222759a281c0e75c348277e0d537a1 Mon Sep 17 00:00:00 2001 From: Sebastian Gaiser Date: Fri, 15 Dec 2023 17:02:54 +0100 Subject: [PATCH] [kube-prometheus-stack] make it possible to disable the coreDns expoter service and servicemonitor - same as kubeEtcd exporter (#4091) Signed-off-by: Sebastian Gaiser Co-authored-by: Gabriel Martinez <19713226+GMartinez-Sisti@users.noreply.github.com> --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../templates/exporters/core-dns/service.yaml | 2 +- .../templates/exporters/core-dns/servicemonitor.yaml | 2 +- charts/kube-prometheus-stack/values.yaml | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index d089c2a6ad60..81556ed20b63 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -21,7 +21,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 55.4.1 +version: 55.5.0 appVersion: v0.70.0 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/exporters/core-dns/service.yaml b/charts/kube-prometheus-stack/templates/exporters/core-dns/service.yaml index 49fbc673ee70..2eaefc4d469a 100644 --- a/charts/kube-prometheus-stack/templates/exporters/core-dns/service.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/core-dns/service.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.coreDns.enabled .Values.kubernetesServiceMonitors.enabled }} +{{- if and .Values.coreDns.enabled .Values.coreDns.service.enabled .Values.kubernetesServiceMonitors.enabled }} apiVersion: v1 kind: Service metadata: diff --git a/charts/kube-prometheus-stack/templates/exporters/core-dns/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/core-dns/servicemonitor.yaml index 5447fde4c561..53d16a5da753 100644 --- a/charts/kube-prometheus-stack/templates/exporters/core-dns/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/core-dns/servicemonitor.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.coreDns.enabled .Values.kubernetesServiceMonitors.enabled }} +{{- if and .Values.coreDns.enabled .Values.coreDns.serviceMonitor.enabled .Values.kubernetesServiceMonitors.enabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index 1f47a6615bbf..e3e1b6a2d71f 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -1493,11 +1493,13 @@ kubeControllerManager: coreDns: enabled: true service: + enabled: true port: 9153 targetPort: 9153 # selector: # k8s-app: kube-dns serviceMonitor: + enabled: true ## Scrape interval. If not set, the Prometheus default scrape interval is used. ## interval: ""