ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
import "k8s.io/api/rbac/v1"
ClusterRoleBinding
ClusterRoleBinding 引用 ClusterRole,但不包含它。 它可以引用全局命名空间中的 ClusterRole,并通过 Subject 添加主体信息。
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata (ObjectMeta)
标准对象的元数据。
roleRef (RoleRef),必需
RoleRef 只能引用全局命名空间中的 ClusterRole。 如果无法解析 RoleRef,则 Authorizer 必定返回一个错误。这个字段是不可变的。
roleRef.apiGroup (string),必需
apiGroup 是被引用资源的组
roleRef.kind (string),必需
kind 是被引用的资源的类别
roleRef.name (string),必需
name 是被引用的资源的名称
subjects ([]Subject)
原子性:将在合并期间被替换
Subjects 包含角色所适用的对象的引用。
Subject 包含对角色绑定所适用的对象或用户标识的引用。其中可以包含直接 API 对象的引用或非对象(如用户名和组名)的值。
subjects.kind (string),必需
被引用的对象的类别。这个 API 组定义的值是
User、Group和ServiceAccount。 如果 Authorizer 无法识别类别值,则 Authorizer 应报告一个错误。subjects.name (string),必需
被引用的对象的名称。
subjects.apiGroup (string)
apiGroup 包含被引用主体的 API 组。对于 ServiceAccount 主体默认为 ""。 对于 User 和 Group 主体,默认为 "rbac.authorization.k8s.io"。
subjects.namespace (string)
被引用对象的命名空间。 如果对象类别是 "User" 或 "Group" 等非命名空间作用域的对象且该值不为空, 则 Authorizer 应报告一个错误。
ClusterRoleBindingList
ClusterRoleBindingList 是 ClusterRoleBinding 的集合。
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBindingList
metadata (ListMeta)
标准的对象元数据。
items ([]ClusterRoleBinding),必需
items 是 ClusterRoleBindings 的列表。
操作
get 读取指定的 ClusterRoleBinding
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}
参数
name (路径参数): string,必需
ClusterRoleBinding 的名称
pretty (查询参数): string
响应
200 (ClusterRoleBinding): OK
401: Unauthorized
list 列出或观测类别为 ClusterRoleBinding 的对象
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/clusterrolebindings
参数
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
sendInitialEvents (查询参数): boolean
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
响应
200 (ClusterRoleBindingList): OK
401: Unauthorized
create 创建 ClusterRoleBinding
HTTP 请求
POST /apis/rbac.authorization.k8s.io/v1/clusterrolebindings
参数
- body: ClusterRoleBinding,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
响应
200 (ClusterRoleBinding): OK
201 (ClusterRoleBinding): Created
202 (ClusterRoleBinding): Accepted
401: Unauthorized
update 替换指定的 ClusterRoleBinding
HTTP 请求
PUT /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}
参数
name (路径参数): string,必需
ClusterRoleBinding 的名称
body: ClusterRoleBinding,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
响应
200 (ClusterRoleBinding): OK
201 (ClusterRoleBinding): Created
401: Unauthorized
patch 部分更新指定的 ClusterRoleBinding
HTTP 请求
PATCH /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}
参数
name (路径参数): string,必需
ClusterRoleBinding 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
响应
200 (ClusterRoleBinding): OK
201 (ClusterRoleBinding): Created
401: Unauthorized
delete 删除 ClusterRoleBinding
HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}
参数
name (路径参数): string,必需
ClusterRoleBinding 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
ignoreStoreReadErrorWithClusterBreakingPotential (查询参数): boolean
pretty (查询参数): string
propagationPolicy (查询参数): string
响应
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection 删除 ClusterRoleBinding 的集合
HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/clusterrolebindings
参数
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
ignoreStoreReadErrorWithClusterBreakingPotential (查询参数): boolean
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
sendInitialEvents (查询参数): boolean
timeoutSeconds (查询参数): integer
响应
200 (Status): OK
401: Unauthorized