Skip to content

Commit

Permalink
fix: splitting the Collecting Dev Workspace Operator metrics procedur…
Browse files Browse the repository at this point in the history
…e into upstream and downstream versions (eclipse-che#2599)

* typo (eclipse-che#2582)

* Revert "typo (eclipse-che#2582)"

This reverts commit 01a4cb0.

* fix: replicating changes from PR 2595 due to a committer's signature issue

---------

Co-authored-by: Jose Manuel <elmanytas@gmail.com>
  • Loading branch information
max-cx and elmanytas committed May 15, 2023
1 parent b5cf8d6 commit f7c9b77
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
. 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-che-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
----
====
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ image::architecture/{project-context}-interacting-with-devworkspace.png[]
Manage User {orch-namespace} and workspaces. The main component is the User dashboard, from which users control their workspaces.

{devworkspace} operator::
Creates and controls the necessary {orch-name} objects to run User workspaces. Including `Pods`, `Services`, and `PeristentVolumes`.
Creates and controls the necessary {orch-name} objects to run User workspaces. Including `Pods`, `Services`, and `PersistentVolumes`.

User workspaces::
Container-based development environments, the IDE included.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ rules:
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: view-openshift-monitoring-prometheus-k8s
name: view-{prod-id-short}-openshift-monitoring-prometheus-k8s
namespace: {prod-namespace} <1>
subjects:
- kind: ServiceAccount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,52 +44,7 @@ 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
----
====
include::example$snip_{project-context}-create-a-role-and-rolebinding-for-prometheus-to-view-metrics.adoc[]

. Allow the in-cluster Prometheus instance to detect the ServiceMonitor in the {prod-short} namespace. The default {prod-short} namespace is `{prod-namespace}`.
+
Expand Down

0 comments on commit f7c9b77

Please sign in to comment.