fascynacja
fascynacja

Reputation: 2826

How to view Roles and ClusterRoles details in kubernetes dashboard

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?

Upvotes: 5

Views: 16614

Answers (2)

EZR
EZR

Reputation: 73

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]

Upvotes: 0

Mark Watney
Mark Watney

Reputation: 5940

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

Upvotes: 11

Related Questions