Skip to content

Commit 68315a7

Browse files
replace servicemonitor for WVA ns with field from metadata (#941)
Signed-off-by: greg pereira <grpereir@redhat.com>
1 parent 5e1e26b commit 68315a7

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

config/default/kustomization.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ patches:
4141
target:
4242
kind: Deployment
4343

44+
# [NAMESPACE-SELECTOR] Ensure the ServiceMonitor namespaceSelector matches the
45+
# deployment namespace. Without this, the hardcoded value in monitor.yaml won't
46+
# update when an overlay changes the namespace (e.g. deploying into 'opendatahub'
47+
# or `redhat-ods-operator`).
48+
replacements:
49+
- source:
50+
kind: Deployment
51+
name: controller-manager
52+
fieldPath: metadata.namespace
53+
targets:
54+
- select:
55+
kind: ServiceMonitor
56+
group: monitoring.coreos.com
57+
version: v1
58+
name: controller-manager-metrics-monitor
59+
fieldPaths:
60+
- spec.namespaceSelector.matchNames.0
61+
4462
# Uncomment the patches line if you enable Metrics and CertManager
4563
# [METRICS-WITH-CERTS] To enable metrics protected with certManager, uncomment the following line.
4664
# This patch will protect the metrics with certManager self-signed certs.

0 commit comments

Comments
 (0)