Skip to content

Instantly share code, notes, and snippets.

@paoloyx
Created February 16, 2021 13:37
Show Gist options
  • Save paoloyx/e6781783c45d90f29118d93d458e1130 to your computer and use it in GitHub Desktop.
Save paoloyx/e6781783c45d90f29118d93d458e1130 to your computer and use it in GitHub Desktop.
Get an overview of all the (Cluster)RoleBindings and the ServiceAccount(s) they reference
kubectl get rolebindings,clusterrolebindings \
--all-namespaces \
-o custom-columns='KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,SERVICE_ACCOUNTS:subjects[?(@.kind=="ServiceAccount")].name'
@paoloyx
Copy link
Author

paoloyx commented Feb 16, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment