Skip to content

Commit bd44a27

Browse files
committed
ServiceMonitor RBAC for authenticated metrics endpoints
Add additional permission to allow Prometheus in OCP to access authenticated metrics without HTTP 500 errors.
1 parent 971d680 commit bd44a27

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,27 @@ rules:
8787
- get
8888
- list
8989
- watch
90+
---
91+
apiVersion: rbac.authorization.k8s.io/v1
92+
kind: ClusterRole
93+
metadata:
94+
name: operator-lifecycle-manager-metrics-reader
95+
rules:
96+
- nonResourceURLs:
97+
- "/metrics"
98+
verbs:
99+
- get
100+
---
101+
apiVersion: rbac.authorization.k8s.io/v1
102+
kind: ClusterRoleBinding
103+
metadata:
104+
name: operator-lifecycle-manager-metrics-reader
105+
roleRef:
106+
apiGroup: rbac.authorization.k8s.io
107+
kind: ClusterRole
108+
name: operator-lifecycle-manager-metrics-reader
109+
subjects:
110+
- kind: ServiceAccount
111+
name: prometheus-k8s
112+
namespace: {{ .Values.monitoring.namespace }}
90113
{{ end }}

0 commit comments

Comments
 (0)