Skip to content

Commit f2e7a0e

Browse files
📖 describe need of RBAC permissions to allow Prometheus Operator to have access to the metrics (#2827)
* Describe the need of RBAC permissions to allow Prometheus Operator to have access to the metrics Signed-off-by: João Vilaça <[email protected]> * Apply suggestions from code review Co-authored-by: Aldo Culquicondor <[email protected]> Co-authored-by: Aldo Culquicondor <[email protected]>
1 parent 7cd3532 commit f2e7a0e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/book/src/reference/metrics.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Follow the steps below to export the metrics using the Prometheus Operator:
5151
We recommend using [kube-prometheus](https://github.com/coreos/kube-prometheus#installing)
5252
in production if you don't have your own monitoring system.
5353
If you are just experimenting, you can only install Prometheus and Prometheus Operator.
54+
5455
2. Uncomment the line `- ../prometheus` in the `config/default/kustomization.yaml`.
5556
It creates the `ServiceMonitor` resource which enables exporting the metrics.
5657

@@ -69,6 +70,20 @@ NAME AGE
6970
monitor-controller-manager-metrics-monitor 2m8s
7071
```
7172

73+
<aside class="warning">
74+
<h2>If you are using Prometheus Operator ensure that you have the required
75+
permissions</h2>
76+
77+
If you are using Prometheus Operator, be aware that, by default, its RBAC
78+
rules are only enabled for the `default` and `kube-system namespaces`. See its
79+
guide to know [how to configure kube-prometheus to monitor other namespaces using the `.jsonnet` file](https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/monitoring-other-namespaces.md).
80+
81+
Alternatively, you can give the Prometheus Operator permissions to monitor other namespaces using RBAC. See the Prometheus Operator
82+
[Enable RBAC rules for Prometheus pods](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/getting-started.md#enable-rbac-rules-for-prometheus-pods)
83+
documentation to know how to enable the permissions on the namespace where the
84+
`ServiceMonitor` and manager exist.
85+
</aside>
86+
7287
Also, notice that the metrics are exported by default through port `8443`. In this way,
7388
you are able to check the Prometheus metrics in its dashboard. To verify it, search
7489
for the metrics exported from the namespace where the project is running

0 commit comments

Comments
 (0)