Skip to content

Commit

Permalink
[kube-prometheus-stack] Use prometheus-node-exporter.namespaceOverrid…
Browse files Browse the repository at this point in the history
…e when set

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
  • Loading branch information
sathieu committed Sep 16, 2021
1 parent 3a3a961 commit c486c90
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 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 @@ -18,7 +18,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 18.0.9
version: 18.0.10
appVersion: 0.50.0
kubeVersion: ">=1.16.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
11 changes: 11 additions & 0 deletions charts/kube-prometheus-stack/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@ Use the kube-state-metrics namespace override for multi-namespace deployments in
{{- end -}}
{{- end -}}

{{/*
Use the prometheus-node-exporter namespace override for multi-namespace deployments in combined charts
*/}}
{{- define "prometheus-node-exporter.namespace" -}}
{{- if index .Values "prometheus-node-exporter" "namespaceOverride" -}}
{{- index .Values "prometheus-node-exporter" "namespaceOverride" -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}

{{/* Allow KubeVersion to be overridden. */}}
{{- define "kube-prometheus-stack.kubeVersion" -}}
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "kube-prometheus-stack.fullname" . }}-node-exporter
namespace: {{ template "kube-prometheus-stack.namespace" . }}
namespace: {{ template "prometheus-node-exporter.namespace" . }}
labels:
app: {{ template "kube-prometheus-stack.name" . }}-node-exporter
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
Expand Down

0 comments on commit c486c90

Please sign in to comment.