All, is there a way to find out roles bound to a user/service account. I believe . . .

Anuoluwapo Fatokun:
all, is there a way to find out roles bound to a user/service account. I believe there should be a cmd for it

Barahalikar Siddharth:
AFAIK there is no command for this.

We need to do kubectl describe rolebinding <rb-name> and check user/sa

Anuoluwapo Fatokun:
found this link https://github.com/kubernetes/kubernetes/issues/53248

Anuoluwapo Fatokun:
tested it and it’s working.

Barahalikar Siddharth:
Are you reffering to this cmd?

kubectl get rolebindings,clusterrolebindings \
  --all-namespaces  \
  -o custom-columns='KIND:kind,<NAMESPACE:metadata.namespace>,<NAME:metadata.name>,SERVICE_ACCOUNTS:subjects[?(@.kind=="ServiceAccount")].name'

Fernando Jordan Silva:
Kubectl get rolebinding,clusterrolebinding -A -oyaml | grep -I <sa>

Anuoluwapo Fatokun:
@Barahalikar Siddharth Yes

Anuoluwapo Fatokun:
@Fernando Jordan Silva that cmd is not working