How to view Roles and ClusterRoles details in kubernetes dashboard
Asked Answered
S

2

5

I am using kubernetes dasboard in version: v1.10.1

When I go to "Roles" tab I can see a list of ClusterRoles and Roles.

k8s dashboard

I would like to see more details about a particular role from the list, but I do not see any "details" button. I want to see information about the role in the dashboard widget or even in yaml format. Am I missing something or this is not possible through dashboard?

Sesterce answered 29/11, 2019 at 13:25 Comment(0)
D
11

Unfortunately it's not possible to achieve what you described in Kubernetes Dashboard even on the most recent version.

To list all Roles on your cluster, you need to use the command line tool (kubectl):

kubectl get rolebindings,clusterrolebindings --all-namespaces -o custom-columns='KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,SERVICE_ACCOUNTS:subjects[?(@.kind=="ServiceAccount")].name'

Than you can extract the yaml file as in this example:

kubectl get clusterrolebindings prometheus -o yaml

Or you can just describe it:

kubectl describe clusterrolebindings prometheus
Deese answered 2/12, 2019 at 9:50 Comment(1)
it is a pity I cannot see it in dashboard. I will use the kubectl solution you provided.Sesterce
W
0

I know it's too late, however might help someone who is using the newer versions. I have tried this one v1.27.2

kubectl describe clusterrole <Name of the Cluster Role>

For Example - Using a newly created role called testrole where I have assigned it to create deployment and statefulsets only.

    $ kubectl describe clusterrole testrole
Name:         testrole
Labels:       <none>
Annotations:  <none>
PolicyRule:
  Resources          Non-Resource URLs  Resource Names  Verbs
  ---------          -----------------  --------------  -----
  deployments.apps   []                 []              [create]
  statefulsets.apps  []                 []              [create]
Wintergreen answered 21/10, 2023 at 23:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.