How can I use kubectl to get all the roles that a service account has?
I can check the accounts bound to a particular role by doing
kubectl get clusterrolebindings somerole
Do I need to get all roles and then filter down?
we can use this one. system:authenticated
service account part of two roles
kubectl get clusterrolebindings -o=jsonpath='{.items[?(@.subjects[].name=="system:authenticated")].roleRef.name}'
system:basic-user system:discovery