How to view Roles and ClusterRoles details in kubernetes dashboard

11/29/2019

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?

-- fascynacja
dashboard
kubernetes
kubernetes-dashboard
rbac

1 Answer

12/2/2019

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
-- mWatney
Source: StackOverflow