Kubernetes 如何使用kubectl检索当前用户授予的RBAC
您可以创建Kubernetes 如何使用kubectl检索当前用户授予的RBAC,kubernetes,kubectl,rbac,Kubernetes,Kubectl,Rbac,您可以创建Role或ClusterRole并通过RoleBinding或ClusterRoleBinding将其分配给用户 从具有令牌的用户视图中,如何通过kubectl获取应用于他的所有授予权限或角色\rolebindings # Check to see if I can do everything in my current namespace ("*" means all) kubectl auth can-i '*' '*' # Check to see if I can
Role
或ClusterRole
并通过RoleBinding
或ClusterRoleBinding
将其分配给用户
从具有令牌的用户视图中,如何通过kubectl
获取应用于他的所有授予权限或角色\rolebindings
# Check to see if I can do everything in my current namespace ("*" means all)
kubectl auth can-i '*' '*'
# Check to see if I can create pods in any namespace
kubectl auth can-i create pods --all-namespaces
# Check to see if I can list deployments in my current namespace
kubectl auth can-i list deployments.extensions
您可以使用kubectl auth--help
命令获取更多信息
您还可以模拟为不同的用户,使用以下标志检查其权限--as
或--as group
kubectl auth can-i create deployments --namespace default --as john.cena