roles
Creating Auth Resources
Auth Resources
ClusterRole
Create a ClusterRole named “foo” with API Group specified.
kubectl create clusterrole foo --verb=get,list,watch --resource=rs.extensions
ClusterRoleBinding
Create a role binding to give a user cluster admin permissions.
kubectl create clusterrolebinding <choose-a-name> --clusterrole=cluster-admin --user=<your-cloud-email-account>
Required Admin Permissions
The cluster-admin role maybe required for creating new RBAC bindings.Role
Create a Role named “foo” with API Group specified.
kubectl create role foo --verb=get,list,watch --resource=rs.extensions
RoleBinding
Create a RoleBinding for user1, user2, and group1 using the admin ClusterRole.
kubectl create rolebinding admin --clusterrole=admin --user=user1 --user=user2 --group=group1
ServiceAccount
Create a new service account named my-service-account
kubectl create serviceaccount my-service-account
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified November 6, 2020: Fix weight for kubectl reference docs (dfda6a2)