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>

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


Last modified November 6, 2020: Fix weight for kubectl reference docs (dfda6a2)