Menu Close

Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

10.2.3. 查看本地角色和绑定

所有 默认集群角色 都可以在本地绑定到用户或组。

可以 创建自定义本地角色

本地角色绑定也可以查看。

查看当前的本地角色绑定集合,这显示绑定到各种角色的用户和组:

$ oc describe rolebinding.rbac

默认情况下,在查看本地角色绑定时使用当前项目。此外,也可通过 -n 标志指定项目。如果用户已经拥有 admin默认集群角色,这 可用于查看另一个项目的本地角色绑定。

$ oc describe rolebinding.rbac -n joe-project
Name:		admin
Labels:		<none>
Annotations:	<none>
Role:
  Kind:	ClusterRole
  Name:	admin
Subjects:
  Kind	Name	Namespace
  ----	----	---------
  User	joe


Name:		system:deployers
Labels:		<none>
Annotations:	<none>
Role:
  Kind:	ClusterRole
  Name:	system:deployer
Subjects:
  Kind			Name		Namespace
  ----			----		---------
  ServiceAccount	deployer	joe-project


Name:		system:image-builders
Labels:		<none>
Annotations:	<none>
Role:
  Kind:	ClusterRole
  Name:	system:image-builder
Subjects:
  Kind			Name	Namespace
  ----			----	---------
  ServiceAccount	builder	joe-project


Name:		system:image-pullers
Labels:		<none>
Annotations:	<none>
Role:
  Kind:	ClusterRole
  Name:	system:image-puller
Subjects:
  Kind	Name					Namespace
  ----	----					---------
  Group	system:serviceaccounts:joe-project