Everest:
Can anyone give me the imperative command for
“Grant the dev-user
permissions to create deployments in the blue
namespace.
Remember to add both groups "apps"
and "extensions"
.”
This is question no 11 of Practice Test Role Based Access Controls.
Mayur Sharma:
- Create role
Kubectl -n blue create role depl-role --resource=deployments
- Create role binding
Kubectl -n blue create rolebindings depl-role-binding --user=dev-user --role=depl-role
Mayur Sharma:
check the yaml before hitting these commands using --dry-run=client -o yaml > file.yaml
Mayur Sharma:
or, can verify kubectl auth can-i create deployment --as=dev-user
Everest:
how about the question saying
Remember to add both groups "apps"
and "extensions"
Mayur Sharma:
have not tried it, but I think there is --group parameter also. Or, save as yaml using dry-run option and then edit the yaml file