Information in this document may be out of date
This document has an older update date than the original, so the information it contains may be out of date. If you're able to read English, see the English version for the most up-to-date information: RoleBinding
RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
import "k8s.io/api/rbac/v1"
RoleBinding
RoleBinding 引用一个角色,但不包含它。 RoleBinding 可以引用相同命名空间中的 Role 或全局命名空间中的 ClusterRole。 RoleBinding 通过 Subjects 和所在的命名空间信息添加主体信息。 处于给定命名空间中的 RoleBinding 仅在该命名空间中有效。
-
apiVersion: rbac.authorization.k8s.io/v1
-
kind: RoleBinding
-
metadata (ObjectMeta)
标准的对象元数据。
-
roleRef (RoleRef),必需
roleRef 可以引用当前命名空间中的 Role 或全局命名空间中的 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 应报告一个错误。
RoleBindingList
RoleBindingList 是 RoleBinding 的集合。
-
apiVersion: rbac.authorization.k8s.io/v1
-
kind: RoleBindingList
-
metadata (ListMeta)
标准的对象元数据。
-
items ([]RoleBinding),必需
items 是 RoleBinding 的列表。
操作
get
读取指定的 RoleBinding
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}
参数
-
name (路径参数): string,必需
RoleBinding 的名称
-
namespace (路径参数): string,必需
-
pretty (查询参数): string
响应
200 (RoleBinding): OK
401: Unauthorized
list
列出或观测类别为 RoleBinding 的对象
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings
参数
-
namespace (路径参数): string,必需
-
allowWatchBookmarks (查询参数): boolean
-
continue (查询参数): string
-
fieldSelector (查询参数): string
-
labelSelector (查询参数): string
-
limit (查询参数): integer
-
pretty (查询参数): string
-
resourceVersion (查询参数): string
-
resourceVersionMatch (查询参数): string
-
sendInitialEvents (查询参数): boolean
-
timeoutSeconds (查询参数): integer
-
watch (查询参数): boolean
响应
200 (RoleBindingList): OK
401: Unauthorized
list
列出或观测类别为 RoleBinding 的对象
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/rolebindings
参数
-
allowWatchBookmarks (查询参数): boolean
-
continue (查询参数): string
-
fieldSelector (查询参数): string
-
labelSelector (查询参数): string
-
limit (查询参数): integer
-
pretty (查询参数): string
-
resourceVersion (查询参数): string
-
resourceVersionMatch (查询参数): string
-
sendInitialEvents (查询参数): boolean
-
timeoutSeconds (查询参数): integer
-
watch (查询参数): boolean
响应
200 (RoleBindingList): OK
401: Unauthorized
create
创建 RoleBinding
HTTP 请求
POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings
参数
-
namespace (路径参数): string,必需
-
body: RoleBinding,必需
-
dryRun (查询参数): string
-
fieldManager (查询参数): string
-
fieldValidation (查询参数): string
-
pretty (查询参数): string
响应
200 (RoleBinding): OK
201 (RoleBinding): Created
202 (RoleBinding): Accepted
401: Unauthorized
update
替换指定的 RoleBinding
HTTP 请求
PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}
参数
-
name (路径参数): string,必需
RoleBinding 的名称
-
namespace (路径参数): string,必需
-
body: RoleBinding,必需
-
dryRun (查询参数): string
-
fieldManager (查询参数): string
-
fieldValidation (查询参数): string
-
pretty (查询参数): string
响应
200 (RoleBinding): OK
201 (RoleBinding): Created
401: Unauthorized
patch
部分更新指定的 RoleBinding
HTTP 请求
PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}
参数
-
name (路径参数): string,必需
RoleBinding 的名称
-
namespace (路径参数): string,必需
-
body: Patch,必需
-
dryRun (查询参数): string
-
fieldManager (查询参数): string
-
fieldValidation (查询参数): string
-
force (查询参数): boolean
-
pretty (查询参数): string
响应
200 (RoleBinding): OK
201 (RoleBinding): Created
401: Unauthorized
delete
删除 RoleBinding
HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}
参数
-
name (路径参数): string,必需
RoleBinding 的名称
-
namespace (路径参数): string,必需
-
body: DeleteOptions
-
dryRun (查询参数): string
-
gracePeriodSeconds (查询参数): integer
-
pretty (查询参数): string
-
propagationPolicy (查询参数): string
响应
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 RoleBinding 的集合
HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings
参数
-
namespace (路径参数): string,必需
-
body: DeleteOptions
-
continue (查询参数): string
-
dryRun (查询参数): string
-
fieldSelector (查询参数): string
-
gracePeriodSeconds (查询参数): integer
-
labelSelector (查询参数): string
-
limit (查询参数): integer
-
pretty (查询参数): string
-
propagationPolicy (查询参数): string
-
resourceVersion (查询参数): string
-
resourceVersionMatch (查询参数): string
-
sendInitialEvents (查询参数): boolean
-
timeoutSeconds (查询参数): integer
响应
200 (Status): OK
401: Unauthorized