Skip to content

Commit 23dcd46

Browse files
committed
deploy/charts: Any monitoring configuration for the PrometheusRule/ServiceMonitor resources
Add a monitoring section to the helm chart values and update the helm conditional check on the PrometheusRule and ServiceMonitor custom resources to gate on wheterh monitoring has been enabled vs. whether the platform is set to "ocp". Signed-off-by: timflannagan <[email protected]>
1 parent 0184d94 commit 23dcd46

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

deploy/chart/templates/0000_90_olm_00-service-monitor.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if and .Values.installType (eq .Values.installType "ocp") }}
1+
{{ if .Values.monitoring.enabled }}
22
apiVersion: monitoring.coreos.com/v1
33
kind: ServiceMonitor
44
metadata:
@@ -70,7 +70,7 @@ roleRef:
7070
subjects:
7171
- kind: ServiceAccount
7272
name: prometheus-k8s
73-
namespace: openshift-monitoring
73+
namespace: {{ .Values.monitoring.namespace }}
7474
---
7575
apiVersion: rbac.authorization.k8s.io/v1
7676
kind: Role

deploy/chart/templates/0000_90_olm_01-prometheus-rule.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if and .Values.installType (eq .Values.installType "ocp") }}
1+
{{ if .Values.monitoring.enabled }}
22
apiVersion: monitoring.coreos.com/v1
33
kind: PrometheusRule
44
metadata:

deploy/chart/values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@ package:
5151
requests:
5252
cpu: 10m
5353
memory: 50Mi
54+
55+
monitoring:
56+
enabled: false
57+
namespace: monitoring

0 commit comments

Comments
 (0)