RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
import "k8s.io/api/rbac/v1"
RoleBinding
RoleBinding 引用了角色,但未包含它。它可以引用同一个命名空间中的 Role 或全局命名空间中的 ClusterRole。它通过 Subjects 添加了 who 信息,通过它所在的命名空间添加了命名空间信息。给定命名空间中的 RoleBindings 仅在该命名空间中有效。
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata (ObjectMeta)
标准对象的元数据。
roleRef (RoleRef), 必填
RoleRef 可以引用当前命名空间中的 Role 或全局命名空间中的 ClusterRole。如果无法解析 RoleRef,授权器必须返回错误。此字段是不可变的。
roleRef.apiGroup (string), 必填
APIGroup 是所引用资源的组
roleRef.kind (string), 必填
Kind 是所引用资源的类型
roleRef.name (string), 必填
Name 是所引用资源的名称
subjects ([]Subject)
Subjects 持有对角色应用到的对象的引用。
Subject 包含对角色绑定应用到的对象或用户身份的引用。这可以保存直接 API 对象引用,也可以保存用户和组名称等非对象的值。
subjects.kind (string), 必填
所引用对象的 Kind。此 API 组定义的值为“User”、“Group”和“ServiceAccount”。如果授权器不识别 kind 值,授权器应报告错误。
subjects.name (string), 必填
所引用对象的 Name。
subjects.apiGroup (string)
APIGroup 持有所引用主题的 API 组。对于 ServiceAccount 主题,默认为“”。对于 User 和 Group 主题,默认为“rbac.authorization.k8s.io”。
subjects.namespace (string)
所引用对象的命名空间。如果对象 Kind 为非命名空间,例如“User”或“Group”,且此值不为空,则授权器应报告错误。
RoleBindingList
RoleBindingList 是 RoleBindings 的集合
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBindingList
metadata (ListMeta)
标准对象的元数据。
items ([]RoleBinding), 必填
Items 是 RoleBindings 的列表
操作
get
读取指定的 RoleBinding
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}
参数
响应
200 (RoleBinding): OK
401: 未授权
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: 未授权
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: 未授权
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): 已创建
202 (RoleBinding): 已接受
401: 未授权
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): 已创建
401: 未授权
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): 已创建
401: 未授权
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): 已接受
401: 未授权
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: 未授权
此页面是自动生成的。
如果您打算报告此页面的问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目中的其他地方进行。