diff --git a/modules/administration-guide/partials/proc_collecting-che-metrics-with-prometheus.adoc b/modules/administration-guide/partials/proc_collecting-che-metrics-with-prometheus.adoc index 0aaf970f55..360d08e1a8 100644 --- a/modules/administration-guide/partials/proc_collecting-che-metrics-with-prometheus.adoc +++ b/modules/administration-guide/partials/proc_collecting-che-metrics-with-prometheus.adoc @@ -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 diff --git a/modules/administration-guide/partials/proc_collecting-dev-workspace-operator-metrics-with-prometheus.adoc b/modules/administration-guide/partials/proc_collecting-dev-workspace-operator-metrics-with-prometheus.adoc index a88a610dfc..91a90f2f35 100644 --- a/modules/administration-guide/partials/proc_collecting-dev-workspace-operator-metrics-with-prometheus.adoc +++ b/modules/administration-guide/partials/proc_collecting-dev-workspace-operator-metrics-with-prometheus.adoc @@ -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"]