Skip to content

Commit

Permalink
fix: replace namespace and app name with placeholders for eclipse-che…
Browse files Browse the repository at this point in the history
…#2586 (eclipse-che#2593)

* fix: replace namespace and app name with placeholders for eclipse-che#2586

Signed-off-by: David Kwon <dakwon@redhat.com>

* Add role and rolebinding to dwo operators metrics setup

Signed-off-by: David Kwon <dakwon@redhat.com>

---------

Signed-off-by: David Kwon <dakwon@redhat.com>
  • Loading branch information
dkwon17 committed Apr 26, 2023
1 parent 247923f commit ac45bb7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ spec:
scheme: http
namespaceSelector:
matchNames:
- openshift-devspaces
- {prod-namespace} <1>
selector:
matchLabels:
app.kubernetes.io/name: devspaces
app.kubernetes.io/name: {prod-deployment}
----
<1> The {prod-short} namespace. The default is `{prod-namespace}`.
<2> The rate at which a target is scraped.
====

. Create a Role and RoleBinding to allow Prometheus view the metrics.
. Create a Role and RoleBinding to allow Prometheus to view the metrics.

+
.Role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,53 @@ spec:
<2> The rate at which a target is scraped.
====

. Create a Role and RoleBinding to allow Prometheus to view the metrics.

+
.Role
====
[source,yaml,subs="+quotes,+attributes,+macros"]
----
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: prometheus-k8s
namespace: openshift-operators
rules:
- verbs:
- get
- list
- watch
apiGroups:
- ''
resources:
- services
- endpoints
- pods
----
====

+
.RoleBinding
====
[source,yaml,subs="+quotes,+attributes,+macros"]
----
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: view-openshift-monitoring-prometheus-k8s
namespace: openshift-operators
subjects:
- kind: ServiceAccount
name: prometheus-k8s
namespace: openshift-monitoring
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: prometheus-k8s
----
====

. Allow the in-cluster Prometheus instance to detect the ServiceMonitor in the {prod-short} namespace. The default {prod-short} namespace is `{prod-namespace}`.
+
[source,subs="+attributes"]
Expand Down

0 comments on commit ac45bb7

Please sign in to comment.