# Metricbeat apiserver metricset needs clusterrole when RBAC enabled in k8s 1.14

**URL:** https://discuss.elastic.co/t/metricbeat-apiserver-metricset-needs-clusterrole-when-rbac-enabled-in-k8s-1-14/219770
**Category:** Beats
**Tags:** metricbeat
**Created:** [February 18, 2020, 11:28am UTC](https://discuss.elastic.co/t/metricbeat-apiserver-metricset-needs-clusterrole-when-rbac-enabled-in-k8s-1-14/219770 "2020-02-18T11:28:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Babadofar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/babadofar/32/44803_2.png) [@Babadofar](https://discuss.elastic.co/u/Babadofar)
#### Post date: [February 18, 2020, 11:28am UTC](https://discuss.elastic.co/t/metricbeat-apiserver-metricset-needs-clusterrole-when-rbac-enabled-in-k8s-1-14/219770/1 "2020-02-18T11:28:04Z")

</div>

with RBAC enabled, the apiserver metricset throws errormessage indicating the user does not have permission. Adding the clusterroles as indicated here [https://kubernetes.io/docs/concepts/cluster-administration/monitoring/](https://kubernetes.io/docs/concepts/cluster-administration/monitoring/) fixes the error.  
The template for clusterroles in metricbeat ([https://github.com/elastic/beats/blob/master/deploy/kubernetes/metricbeat/metricbeat-role.yaml](https://github.com/elastic/beats/blob/master/deploy/kubernetes/metricbeat/metricbeat-role.yaml)) should be appended with this rule:

```
rules:	
  - nonResourceURLs:	
      - "/metrics"	
    verbs:	
      - get
```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 17, 2020, 11:28am UTC](https://discuss.elastic.co/t/metricbeat-apiserver-metricset-needs-clusterrole-when-rbac-enabled-in-k8s-1-14/219770/2 "2020-03-17T11:28:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
