Role
apiVersion: rbac.authorization.k8s.io/v1
import "k8s.io/api/rbac/v1"
Role
Role 是一种带命名空间的、PolicyRule 的逻辑分组,可由 RoleBinding 作为一个整体引用。
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata (ObjectMeta)
标准对象的元数据。
rules ([]PolicyRule)
原子操作:将在合并期间被替换
Rules 包含此 Role 的所有 PolicyRule
PolicyRule 保存描述策略规则的信息,但不包含规则适用于谁或适用于哪个命名空间的信息。
rules.apiGroups ([]string)
原子操作:将在合并期间被替换
APIGroup 是包含资源的 APIGroup 的名称。如果指定了多个 API Group,则允许对任何 API Group 中所列举的资源执行任何请求的操作。"" 表示核心 API Group,"*" 表示所有 API Group。
rules.resources ([]string)
原子操作:将在合并期间被替换
Resources 是此规则适用的资源列表。'*' 表示所有资源。
rules.verbs ([]string),必需
原子操作:将在合并期间被替换
Verbs 是应用于此规则中包含的所有 ResourceKind 的动词列表。'*' 表示所有动词。
rules.resourceNames ([]string)
原子操作:将在合并期间被替换
ResourceNames 是一个可选的白名单,列出了规则适用的名称。空集表示允许所有名称。
rules.nonResourceURLs ([]string)
原子操作:将在合并期间被替换
NonResourceURLs 是一组用户应有权访问的部分 URL。允许使用 *,但仅作为路径中完整且最后一部分。由于非资源 URL 没有命名空间,此字段仅适用于从 ClusterRoleBinding 引用的 ClusterRole。规则可以应用于 API 资源(例如 "pods" 或 "secrets")或非资源 URL 路径(例如 "/api"),但不能同时应用两者。
RoleList
RoleList 是 Role 的集合
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleList
metadata (ListMeta)
标准对象的元数据。
items ([]Role),必需
Items 是 Role 的列表
操作
get
读取指定的 Role
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
参数
响应
200 (Role):成功
401:未经授权
list
列出或监视 kind 为 Role 的对象
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
参数
namespace (在路径中): 字符串,必需
allowWatchBookmarks (在查询中): 布尔值
continue (在查询中): 字符串
fieldSelector (在查询中): 字符串
labelSelector (在查询中): 字符串
limit (在查询中): 整型
pretty (在查询中): 字符串
resourceVersion (在查询中): 字符串
resourceVersionMatch (在查询中): 字符串
sendInitialEvents (在查询中): 布尔值
timeoutSeconds (在查询中): 整型
watch (在查询中): 布尔值
响应
200 (RoleList):成功
401:未经授权
list
列出或监视 kind 为 Role 的对象
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/roles
参数
allowWatchBookmarks (在查询中): 布尔值
continue (在查询中): 字符串
fieldSelector (在查询中): 字符串
labelSelector (在查询中): 字符串
limit (在查询中): 整型
pretty (在查询中): 字符串
resourceVersion (在查询中): 字符串
resourceVersionMatch (在查询中): 字符串
sendInitialEvents (在查询中): 布尔值
timeoutSeconds (在查询中): 整型
watch (在查询中): 布尔值
响应
200 (RoleList):成功
401:未经授权
create
创建一个 Role
HTTP 请求
POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
参数
namespace (在路径中): 字符串,必需
body: Role,必需
dryRun (在查询中): 字符串
fieldManager (在查询中): 字符串
fieldValidation (在查询中): 字符串
pretty (在查询中): 字符串
响应
200 (Role):成功
201 (Role):已创建
202 (Role):已接受
401:未经授权
update
替换指定的 Role
HTTP 请求
PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
参数
name (在路径中): 字符串,必需
Role 的名称
namespace (在路径中): 字符串,必需
body: Role,必需
dryRun (在查询中): 字符串
fieldManager (在查询中): 字符串
fieldValidation (在查询中): 字符串
pretty (在查询中): 字符串
响应
200 (Role):成功
201 (Role):已创建
401:未经授权
patch
部分更新指定的 Role
HTTP 请求
PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
参数
name (在路径中): 字符串,必需
Role 的名称
namespace (在路径中): 字符串,必需
body: Patch,必需
dryRun (在查询中): 字符串
fieldManager (在查询中): 字符串
fieldValidation (在查询中): 字符串
force (在查询中): 布尔值
pretty (在查询中): 字符串
响应
200 (Role):成功
201 (Role):已创建
401:未经授权
delete
删除一个 Role
HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
参数
name (在路径中): 字符串,必需
Role 的名称
namespace (在路径中): 字符串,必需
body: DeleteOptions
dryRun (在查询中): 字符串
gracePeriodSeconds (在查询中): 整型
ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): 布尔值
pretty (在查询中): 字符串
propagationPolicy (在查询中): 字符串
响应
200 (Status):成功
202 (Status):已接受
401:未经授权
deletecollection
删除 Role 集合
HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
参数
namespace (在路径中): 字符串,必需
body: DeleteOptions
continue (在查询中): 字符串
dryRun (在查询中): 字符串
fieldSelector (在查询中): 字符串
gracePeriodSeconds (在查询中): 整型
ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): 布尔值
labelSelector (在查询中): 字符串
limit (在查询中): 整型
pretty (在查询中): 字符串
propagationPolicy (在查询中): 字符串
resourceVersion (在查询中): 字符串
resourceVersionMatch (在查询中): 字符串
sendInitialEvents (在查询中): 布尔值
timeoutSeconds (在查询中): 整型
响应
200 (Status):成功
401:未经授权
本页面是自动生成的。
如果你计划报告本页面的问题,请在问题描述中注明此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。