Skip to content

Commit 136f917

Browse files
committed
Prometheus: watch CRs in all namespaces
This allows application to create ServiceMonitors in their own namespace . Fits much better with our least privilege and multi-tenancy approaches. On top of that remove the need to add a label to each ServiceMonitor. This makes them easier to use. Note that any: true instead of matchLabels: {} as described here: prometheus-community/helm-charts#106 fails, because not in schema.
1 parent 6acf4f6 commit 136f917

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

applications/cluster-resources/monitoring/prometheus-stack-helm-values.ftl.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,22 @@ grafana:
162162

163163
prometheus:
164164
prometheusSpec:
165+
# Find podMonitors, serviceMonitor, etc. in all namespaces
166+
serviceMonitorNamespaceSelector:
167+
matchLabels: {}
168+
# With this, we don't need the label "release: kube-prometheus-stack" on the service monitor
169+
serviceMonitorSelectorNilUsesHelmValues: false
170+
podMonitorNamespaceSelector:
171+
matchLabels: {}
172+
podMonitorSelectorNilUsesHelmValues: false
173+
ruleNamespaceSelector:
174+
matchLabels: {}
175+
ruleSelectorNilUsesHelmValues: false
176+
scrapeConfigSelectorNilUsesHelmValues: false
177+
probeNamespaceSelector:
178+
matchLabels: {}
179+
probeSelectorNilUsesHelmValues: false
180+
165181
<#if podResources == true>
166182
resources:
167183
limits:

0 commit comments

Comments
 (0)