Which RBAC role is required to get service account token?

Solution Unverified - Updated -

Issue

  • We need a token for prometheus-k8s service account to access metrics data, but oc serviceaccounts get-token command run by a user with view ClusterRole fails with the following error.

    $ oc serviceaccounts get-token prometheus-k8s -n openshift-monitoring
    error: could not find a service account token for service account "prometheus-k8s"
    
  • Which RBAC role is required to get service account token?

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content