Find which RoleBinding/ClusterRoleBinding is related to a ServiceAccount
kubectl get clusterrolebindings -o json | jq -r '
.items[] |
select(
.subjects // [] | .[] |
[.kind,.namespace,.name] == ["ServiceAccount","kube-system","node-controller"]
) |
.metadata.name'
kubectl get clusterrolebindings -o json | jq -r '.items[] | select(.subjects // [] | .[] | [.name] == [""] ) | .metadata.name'
kubectl get rolebindings --all-namespaces -o