May 2019
Intermediate to advanced
442 pages
11h 36m
English
Before proceeding with the setup of Prometheus, we'll need to grant its instances with the right access control permissions. The following snippets from the Prometheus RBAC manifest do just that. First we need to create a ClusterRole that allows Prometheus access to /metrics through GET requests:
apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRolemetadata: name: prometheus-k8srules:...- nonResourceURLs: - /metrics verbs: - get
Next, we create a ClusterRoleBinding to grant the permissions from the aforementioned ClusterRole to a user, which in our case will be a ServiceAccount:
apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata: name: prometheus-k8sroleRef: apiGroup: rbac.authorization.k8s.io ...
Read now
Unlock full access