Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 1.04 KB

monitoring-creating-a-role-for-setting-up-metrics-collection.adoc

File metadata and controls

36 lines (30 loc) · 1.04 KB

Creating a role for setting up metrics collection

This procedure shows how to create a role that allows a user to set up metrics collection for a service as described in "Setting up metrics collection".

Procedure
  1. Create a YAML file for the new role. In this example, it is called custom-metrics-role.yaml.

  2. Fill the file with the configuration for the monitor-crd-edit role:

    kind: ClusterRole
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
      name: monitor-crd-edit
    rules:
    - apiGroups: ["monitoring.coreos.com"]
      resources: ["prometheusrules", "servicemonitors", "podmonitors"]
      verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

    This role enables a user to set up metrics collection for services.

  3. Apply the configuration file to the cluster:

    $ oc apply -f custom-metrics-role.yaml

    Now the role is created.