2.3. Granting user permissions using web console
This procedure shows how to grant users permissions for monitoring their own services using the web console.
Prerequisites
- Have a user created.
- Log in to the web console as a cluster administrator.
Procedure
-
In the web console, navigate to User Management
Role Bindings Create Binding. - In Binding Type, select the "Namespace Role Binding" type.
- In Name, enter a name for the binding.
-
In Namespace, select the namespace where you want to grant the access. For example, select
ns1
. In Role Name, enter
monitoring-rules-view
,monitoring-rules-edit
, ormonitoring-edit
.-
monitoring-rules-view
allows readingPrometheusRule
custom resources within the namespace. -
monitoring-rules-edit
allows creating, modifying, and deletingPrometheusRule
custom resources matching the permitted namespace. -
monitoring-edit
gives the same permissions asmonitoring-rules-edit
. Additionally, it allows creating scraping targets for services or pods. It also allows creating, modifying, and deletingServiceMonitor
andPodMonitor
resources.
重要Whichever role you choose, you must bind it against a specific namespace as a cluster administrator.
For example, enter
monitoring-edit
.-
- In Subject, select User.
-
In Subject Name, enter the name of the user. For example, enter
johnsmith
. -
Confirm the role binding. If you followed the example, then user
johnsmith
has been assigned the permissions for setting up metrics collection and creating alerting rules in thens1
namespace.