ClusterRole

ClusterRole 是集群级别的 PolicyRules 逻辑分组,可以通过 RoleBinding 或 ClusterRoleBinding 作为单元进行引用。

apiVersion: rbac.authorization.k8s.io/v1

import "k8s.io/api/rbac/v1"

ClusterRole

ClusterRole 是集群级别的 PolicyRules 逻辑分组,可以通过 RoleBinding 或 ClusterRoleBinding 作为单元进行引用。


  • apiVersion: rbac.authorization.k8s.io/v1

  • kind: ClusterRole

  • metadata (ObjectMeta)

    标准对象的元数据。

  • aggregationRule (AggregationRule)

    AggregationRule 是一个可选字段,它描述了如何构建此 ClusterRole 的规则。如果设置了 AggregationRule,则规则将由控制器管理,对规则的直接更改将被控制器覆盖。

    AggregationRule 描述了如何定位要聚合到 ClusterRole 中的 ClusterRoles

    • aggregationRule.clusterRoleSelectors ([]LabelSelector)

      ClusterRoleSelectors 持有一个选择器列表,这些选择器将用于查找 ClusterRoles 并创建规则。如果任何选择器匹配,则将添加 ClusterRole 的权限

  • rules ([]PolicyRule)

    Rules 包含此 ClusterRole 的所有 PolicyRules

    PolicyRule 包含描述策略规则的信息,但不包含有关规则适用于谁或规则适用于哪个命名空间的信息。

    • rules.apiGroups ([]string)

      APIGroups 是包含资源的 APIGroup 的名称。如果指定了多个 API 组,则允许针对任何 API 组中列出的任何资源请求的任何操作。"" 代表核心 API 组,"*" 代表所有 API 组。

    • rules.resources ([]string)

      Resources 是此规则适用的资源列表。'*' 代表所有资源。

    • rules.verbs ([]string), required

      Verbs 是适用于此规则中包含的所有 ResourceKinds 的 Verbs 列表。'*' 代表所有动词。

    • rules.resourceNames ([]string)

      ResourceNames 是规则适用的名称的可选白名单。空集表示允许所有内容。

    • rules.nonResourceURLs ([]string)

      NonResourceURLs 是用户应该访问的一组部分 URL。允许使用 "*",但仅作为路径中的完整最终步骤。由于非资源 URL 不是命名空间的,因此此字段仅适用于从 ClusterRoleBinding 引用的 ClusterRoles。规则可以应用于 API 资源(例如“pods”或“secrets”)或非资源 URL 路径(例如“/api”),但不能两者兼而有之。

ClusterRoleList

ClusterRoleList 是 ClusterRoles 的集合


  • apiVersion: rbac.authorization.k8s.io/v1

  • kind: ClusterRoleList

  • metadata (ListMeta)

    标准对象的元数据。

  • items ([]ClusterRole), required

    Items 是 ClusterRoles 的列表

操作


get 读取指定的 ClusterRole

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}

参数

  • name (在路径中): string, required

    ClusterRole 的名称

  • pretty (在查询中): string

    pretty

响应

200 (ClusterRole): OK

401: 未经授权

list 列出或观察 ClusterRole 类型的对象

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/clusterroles

参数

响应

200 (ClusterRoleList): OK

401: 未经授权

create 创建一个 ClusterRole

HTTP 请求

POST /apis/rbac.authorization.k8s.io/v1/clusterroles

参数

响应

200 (ClusterRole): OK

201 (ClusterRole): 已创建

202 (ClusterRole): 已接受

401: 未经授权

update 替换指定的 ClusterRole

HTTP 请求

PUT /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}

参数

  • name (在路径中): string, required

    ClusterRole 的名称

  • body: ClusterRole, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • pretty (在查询中): string

    pretty

响应

200 (ClusterRole): OK

201 (ClusterRole): 已创建

401: 未经授权

patch 部分更新指定的 ClusterRole

HTTP 请求

PATCH /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}

参数

  • name (在路径中): string, required

    ClusterRole 的名称

  • body: Patch, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (ClusterRole): OK

201 (ClusterRole): 已创建

401: 未经授权

delete 删除一个 ClusterRole

HTTP 请求

DELETE /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}

参数

响应

200 (Status): OK

202 (Status): 已接受

401: 未经授权

deletecollection 删除 ClusterRole 的集合

HTTP 请求

DELETE /apis/rbac.authorization.k8s.io/v1/clusterroles

参数

响应

200 (Status): OK

401: 未经授权

此页面是自动生成的。

如果您打算报告此页面出现问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。

上次修改时间:2023 年 7 月 26 日下午 1:45 PST:生成的內容 (1e2ed88743)