Is there a way to generate yaml files for role and rolebinding creation using ku . . .

K8ns:
Is there a way to generate yaml files for role and rolebinding creation using kubectl create role …? --dry-run option doesn’t work with it… Thank you for helping

VIP:

VIP:

VIP:
yaml options works for both role and rolebindings

Mohamed Ayman:
Yes, It will work as above.

K8ns:
Thank you for quick response… I am asking about --dry-run=client and -o yaml… Does those work for kubectl create role command?

Mohamed Ettaki Talbi:
just try it, it works

K8ns:
thanks it worked… there was typo in my command