鉴权资源
- 1: LocalSubjectAccessReview
- 2: SelfSubjectAccessReview
- 3: SelfSubjectRulesReview
- 4: SubjectAccessReview
- 5: ClusterRole
- 6: ClusterRoleBinding
- 7: Role
- 8: RoleBinding
1 - LocalSubjectAccessReview
apiVersion: authorization.k8s.io/v1
import "k8s.io/api/authorization/v1"
LocalSubjectAccessReview
LocalSubjectAccessReview 检查用户或组是否可以在给定的命名空间内执行某操作。 划分命名空间范围的资源简化了命名空间范围的策略设置,例如权限检查。
- 
apiVersion: authorization.k8s.io/v1 
- 
kind: LocalSubjectAccessReview 
- 
metadata (ObjectMeta) 标准的列表元数据。 更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 
- 
spec (SubjectAccessReviewSpec),必需 spec 包含有关正在评估的请求的信息。 spec.namespace 必须是你的请求所针对的命名空间。 如果留空,则会被设置默认值。 
- 
status (SubjectAccessReviewStatus) status 由服务器填写,表示请求是否被允许。 
操作
create 创建 LocalSubjectAccessReview
HTTP 请求
POST /apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews
参数
- 
namespace (路径参数): string,必需 
- 
body: LocalSubjectAccessReview,必需 
- 
dryRun (查询参数): string 
- 
fieldManager (查询参数): string 
- 
fieldValidation (查询参数): string 
- 
pretty (查询参数): string 
响应
200 (LocalSubjectAccessReview): OK
201 (LocalSubjectAccessReview): Created
202 (LocalSubjectAccessReview): Accepted
401: Unauthorized
2 - SelfSubjectAccessReview
apiVersion: authorization.k8s.io/v1
import "k8s.io/api/authorization/v1"
SelfSubjectAccessReview
SelfSubjectAccessReview 检查当前用户是否可以执行某操作。
不填写 spec.namespace 表示“在所有命名空间中”。
Self 是一个特殊情况,因为用户应始终能够检查自己是否可以执行某操作。
- 
apiVersion: authorization.k8s.io/v1 
- 
kind: SelfSubjectAccessReview 
- 
metadata (ObjectMeta) 标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 
- 
spec (SelfSubjectAccessReviewSpec),必需 spec 包含有关正在评估的请求的信息。 user 和 group 必须为空。 
- 
status (SubjectAccessReviewStatus) status 由服务器填写,表示请求是否被允许。 
SelfSubjectAccessReviewSpec
SelfSubjectAccessReviewSpec 是访问请求的描述。 resourceAuthorizationAttributes 和 nonResourceAuthorizationAttributes 二者必须设置其一,并且只能设置其一。
- 
nonResourceAttributes (NonResourceAttributes) nonResourceAttributes 描述非资源访问请求的信息。 nonResourceAttributes 包括提供给 Authorizer 接口进行非资源请求鉴权时所用的属性。 - 
nonResourceAttributes.path (string) path 是请求的 URL 路径。 
- 
nonResourceAttributes.verb (string) verb 是标准的 HTTP 动作。 
 
- 
- 
resourceAttributes (ResourceAttributes) resourceAuthorizationAttributes 描述资源访问请求的信息。 resourceAttributes 包括提供给 Authorizer 接口进行资源请求鉴权时所用的属性。 - 
resourceAttributes.fieldSelector (FieldSelectorAttributes) fieldSelector 描述基于字段的访问限制。此字段只能限制访问权限,而不能扩大访问权限。 FieldSelectorAttributes 表示一个限制访问的字段。建议 Webhook 的开发者们: - 确保 rawSelector 和 requirements 未被同时设置。
- 如果设置了 fieldSelector,则考虑 requirements 字段。
- 如果设置了 fieldSelector,不要尝试解析或考虑 rawSelector 字段。
 这是为了避免出现另一个 CVE-2022-2880(即我们不希望不同系统以一致的方式解析某个查询), 有关细节参见 https://www.oxeye.io/resources/golang-parameter-smuggling-attack。 对于 kube-apiserver 的 SubjectAccessReview 端点: - 如果 rawSelector 为空且 requirements 为空,则请求未被限制。
- 如果 rawSelector 存在且 requirements 为空,则 rawSelector 将被解析,并在解析成功的情况下进行限制。
- 如果 rawSelector 为空且 requirements 存在,则应优先使用 requirements。
- 如果 rawSelector 存在,requirements 也存在,则请求无效。
 - 
resourceAttributes.fieldSelector.rawSelector (string) rawSelector 是字段选择算符的序列化形式,将被包含在查询参数中。 建议 Webhook 实现忽略 rawSelector。只要 requirements 不存在, kube-apiserver 的 SubjectAccessReview 将解析 rawSelector。 
 - 
resourceAttributes.fieldSelector.requirements ([]FieldSelectorRequirement) 原子:将在合并期间被替换 requirements 是字段选择算符已解析的解释。资源实例必须满足所有 requirements 才能匹配此选择算符。 Webhook 实现应处理 requirements,但如何处理由 Webhook 自行决定。 由于 requirements 只能限制请求,因此如果不理解 requirements,可以安全地将请求鉴权为无限制请求。 FieldSelectorRequirement 是一个选择算符,包含值、键以及与将键和值关联起来的运算符。 - 
resourceAttributes.fieldSelector.requirements.key (string),必需 key 是 requirements 应用到的字段选择算符键。 
- 
resourceAttributes.fieldSelector.requirements.operator (string),必需 operator 表示键与一组值之间的关系。有效的运算符有 In、NotIn、Exists、DoesNotExist。 运算符列表可能会在未来增加。 
- 
resourceAttributes.fieldSelector.requirements.values([]string) 原子:将在合并期间被替换 values 是一个字符串值的数组。如果运算符是 In 或 NotIn,则 values 数组必须非空。 如果运算符是 Exists 或 DoesNotExist,则 values 数组必须为空。 
 
- 
 
 - 
resourceAttributes.group (string) group 是资源的 API 组。"*" 表示所有组。 
 - 
resourceAttributes.labelSelector (LabelSelectorAttributes) labelSelector 描述基于标签的访问限制。此字段只能限制访问权限,而不能扩大访问权限。 LabelSelectorAttributes 表示通过标签限制的访问。建议 Webhook 开发者们: - 确保 rawSelector 和 requirements 未被同时设置。
- 如果设置了 labelSelector,则考虑 requirements 字段。
- 如果设置了 labelSelector,不要尝试解析或考虑 rawSelector 字段。
 这是为了避免出现另一个 CVE-2022-2880(即让不同系统以一致的方式解析为何某个查询不是我们想要的), 有关细节参见 https://www.oxeye.io/resources/golang-parameter-smuggling-attack 对于 kube-apiserver 的 SubjectAccessReview 端点: - 如果 rawSelector 为空且 requirements 为空,则请求未被限制。
- 如果 rawSelector 存在且 requirements 为空,则 rawSelector 将被解析,并在解析成功的情况下进行限制。
- 如果 rawSelector 为空且 requirements 存在,则应优先使用 requirements。
- 如果 rawSelector 存在,requirements 也存在,则请求无效。
 - 
resourceAttributes.labelSelector.rawSelector (string) rawSelector 是字段选择算符的序列化形式,将被包含在查询参数中。 建议 Webhook 实现忽略 rawSelector。只要 requirements 不存在, kube-apiserver 的 SubjectAccessReview 将解析 rawSelector。 
 - 
resourceAttributes.labelSelector.requirements ([]LabelSelectorRequirement) 原子:将在合并期间被替换 requirements 是字段选择算符已解析的解释。资源实例必须满足所有 requirements,才能匹配此选择算符。 Webhook 实现应处理 requirements,但如何处理由 Webhook 自行决定。 由于 requirements 只能限制请求,因此如果不理解 requirements,可以安全地将请求鉴权为无限制请求。 FieldSelectorRequirement 是一个选择算符,包含值、键以及将键和值关联起来的运算符。 - 
resourceAttributes.labelSelector.requirements.key (string),必需 key 是选择算符应用到的标签键。 
- 
resourceAttributes.labelSelector.requirements.operator (string),必需 operator 表示键与一组值之间的关系。有效的运算符有 In、NotIn、Exists、DoesNotExist。 
- 
resourceAttributes.labelSelector.requirements.values ([]string) 原子:将在合并期间被替换 values 是一个字符串值的数组。如果运算符是 In 或 NotIn,则 values 数组必须非空。 如果运算符是 Exists 或 DoesNotExist,则 values 数组必须为空。 此数组在策略性合并补丁(Strategic Merge Patch)期间被替换。 
 
- 
 
 - 
resourceAttributes.name (string) name 是 "get" 正在请求或 "delete" 已删除的资源的名称。 ""(空字符串)表示所有资源。 
 - 
resourceAttributes.namespace (string) namespace 是正在请求的操作的命名空间。 目前,无命名空间和所有命名空间之间没有区别。 对于 LocalSubjectAccessReviews,默认为 ""(空字符串)。 对于集群范围的资源,默认为 ""(空字符串)。 对于来自 SubjectAccessReview 或 SelfSubjectAccessReview 的命名空间范围的资源, ""(空字符串)表示 "all"(所有资源)。 
- 
resourceAttributes.resource (string) resource 是现有的资源类别之一。"*" 表示所有资源类别。 
 - 
resourceAttributes.subresource (string) subresource 是现有的资源类型之一。"" 表示无。 
- 
resourceAttributes.verb (string) verb 是 kubernetes 资源 API 动作,例如 get、list、watch、create、update、delete、proxy。 "*" 表示所有动作。 
- 
resourceAttributes.version (string) version 是资源的 API 版本。"*" 表示所有版本。 
 
- 
操作
create 创建 SelfSubjectAccessReview
HTTP 请求
POST /apis/authorization.k8s.io/v1/selfsubjectaccessreviews
参数
- 
body: SelfSubjectAccessReview,必需 
- 
dryRun (查询参数): string 
- 
fieldManager (查询参数): string 
- 
fieldValidation (查询参数): string 
- 
pretty (查询参数): string 
响应
200 (SelfSubjectAccessReview): OK
201 (SelfSubjectAccessReview): Created
202 (SelfSubjectAccessReview): Accepted
401: Unauthorized
3 - SelfSubjectRulesReview
apiVersion: authorization.k8s.io/v1
import "k8s.io/api/authorization/v1"
SelfSubjectRulesReview
SelfSubjectRulesReview 枚举当前用户可以在某命名空间内执行的操作集合。 返回的操作列表可能不完整,具体取决于服务器的鉴权模式以及评估过程中遇到的任何错误。 SelfSubjectRulesReview 应由 UI 用于显示/隐藏操作,或让最终用户尽快理解自己的权限。 SelfSubjectRulesReview 不得被外部系统使用以驱动鉴权决策, 因为这会引起混淆代理人(Confused deputy)、缓存有效期/吊销(Cache lifetime/revocation)和正确性问题。 SubjectAccessReview 和 LocalAccessReview 是遵从 API 服务器所做鉴权决策的正确方式。
- 
apiVersion: authorization.k8s.io/v1 
- 
kind: SelfSubjectRulesReview 
- 
metadata (ObjectMeta) 标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 
- 
spec (SelfSubjectRulesReviewSpec),必需 spec 包含有关正在评估的请求的信息。 
- 
status (SubjectRulesReviewStatus) status 由服务器填写,表示用户可以执行的操作的集合。 SubjectRulesReviewStatus 包含规则检查的结果。 此检查可能不完整,具体取决于服务器配置的 Authorizer 的集合以及评估期间遇到的任何错误。 由于鉴权规则是叠加的,所以如果某个规则出现在列表中,即使该列表不完整,也可以安全地假定该主体拥有该权限。 - 
status.incomplete (boolean),必需 当此调用返回的规则不完整时,incomplete 结果为 true。 这种情况常见于 Authorizer(例如外部 Authorizer)不支持规则评估时。 
- 
status.nonResourceRules ([]NonResourceRule),必需 原子性:合并期间将被替换 nonResourceRules 是允许主体对非资源执行路径执行的操作列表。 该列表顺序不重要,可以包含重复项,还可能不完整。 nonResourceRule 包含描述非资源路径的规则的信息。 - 
status.nonResourceRules.verbs ([]string),必需 原子性:合并期间将被替换 verb 是 kubernetes 非资源 API 动作的列表,例如 get、post、put、delete、patch、head、options。 *表示所有动作。
- 
status.nonResourceRules.nonResourceURLs ([]string) nonResourceURLs 是用户应有权访问的一组部分 URL。 允许使用 *,但仅能作为路径中最后一段且必须用于完整的一段。*表示全部。
 
- 
 - 
status.resourceRules ([]ResourceRule),必需 原子性:合并期间将被替换 resourceRules 是允许主体对资源执行的操作的列表。 该列表顺序不重要,可以包含重复项,还可能不完整。 resourceRule 是允许主体对资源执行的操作的列表。该列表顺序不重要,可以包含重复项,还可能不完整。 - 
status.resourceRules.verbs ([]string),必需 原子性:合并期间将被替换 verb 是 kubernetes 资源 API 动作的列表,例如 get、list、watch、create、update、delete、proxy。 *表示所有动作。
 - 
status.resourceRules.apiGroups ([]string) 原子性:合并期间将被替换 apiGroups 是包含资源的 APIGroup 的名称。 如果指定了多个 API 组,则允许对任何 API 组中枚举的资源之一请求任何操作。 *表示所有 APIGroup。
- 
status.resourceRules.resourceNames ([]string) 原子性:合并期间将被替换 resourceNames 是此规则所适用的资源名称白名单,可选。 空集合意味着允许所有资源。 *表示所有资源。
- 
status.resourceRules.resources ([]string) 原子性:合并期间将被替换 resources 是此规则所适用的资源的列表。 *表示指定 APIGroup 中的所有资源。*/foo表示指定 APIGroup 中所有资源的子资源 "foo"。
 
- 
 - 
status.evaluationError (string) evaluationError 可以与 rules 一起出现。 它表示在规则评估期间发生错误,例如 Authorizer 不支持规则评估以及 resourceRules 和/或 nonResourceRules 可能不完整。 
 
- 
SelfSubjectRulesReviewSpec
SelfSubjectRulesReviewSpec 定义 SelfSubjectRulesReview 的规范。
- 
namespace (string) namespace 是要评估规则的命名空间。 必需。 
操作
create 创建 SelfSubjectRulesReview
HTTP 请求
POST /apis/authorization.k8s.io/v1/selfsubjectrulesreviews
参数
- 
body: SelfSubjectRulesReview,必需 
- 
dryRun (查询参数): string 
- 
fieldManager (查询参数): string 
- 
fieldValidation (查询参数): string 
- 
pretty (查询参数): string 
响应
200 (SelfSubjectRulesReview): OK
201 (SelfSubjectRulesReview): Created
202 (SelfSubjectRulesReview): Accepted
401: Unauthorized
4 - SubjectAccessReview
apiVersion: authorization.k8s.io/v1
import "k8s.io/api/authorization/v1"
SubjectAccessReview
SubjectAccessReview 检查用户或组是否可以执行某操作。
- 
apiVersion: authorization.k8s.io/v1 
- 
kind: SubjectAccessReview 
- 
metadata (ObjectMeta) 标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 
- 
spec (SubjectAccessReviewSpec),必需 spec 包含有关正在评估的请求的信息。 
- 
status (SubjectAccessReviewStatus) status 由服务器填写,表示请求是否被允许。 
SubjectAccessReviewSpec
SubjectAccessReviewSpec 是访问请求的描述。 resourceAuthorizationAttributes 和 nonResourceAuthorizationAttributes 二者必须设置其一,并且只能设置其一。
- 
extra (map[string][]string) extra 对应于来自鉴权器的 user.Info.GetExtra() 方法。 由于这是针对 Authorizer 的输入,所以它需要在此处反映。 
- 
groups ([]string) 原子:将在合并期间被替换 groups 是你正在测试的组。 
- 
nonResourceAttributes (NonResourceAttributes) nonResourceAttributes 描述非资源访问请求的信息。 nonResourceAttributes 包括提供给 Authorizer 接口进行非资源请求鉴权时所用的属性。 - 
nonResourceAttributes.path (string) path 是请求的 URL 路径。 
- 
nonResourceAttributes.verb (string) verb 是标准的 HTTP 动作。 
 
- 
- 
resourceAttributes (ResourceAttributes) resourceAuthorizationAttributes 描述资源访问请求的信息。 resourceAttributes 包括提供给 Authorizer 接口进行资源请求鉴权时所用的属性。 - 
resourceAttributes.fieldSelector (FieldSelectorAttributes) fieldSelector 描述基于字段的访问限制。此字段只能限制访问权限,而不能扩大访问权限。 FieldSelectorAttributes 表示一个限制访问的字段。建议 Webhook 的开发者们: - 确保 rawSelector 和 requirements 未被同时设置
- 如果设置,则考虑 requirements 字段
- 如果设置,不要尝试解析或考虑 rawSelector 字段。
 这是为了避免出现另一个 CVE-2022-2880(即我们不希望不同系统以一致的方式解析某个查询), 有关细节参见 https://www.oxeye.io/resources/golang-parameter-smuggling-attack 对于 kube-apiserver 的 SubjectAccessReview 端点: - 如果 rawSelector 为空且 requirements 为空,则请求未被限制。
- 如果 rawSelector 存在且 requirements 为空,则 rawSelector 将被解析,并在解析成功的情况下进行限制。
- 如果 rawSelector 为空且 requirements 存在,则应优先使用 requirements。
- 如果 rawSelector 存在,requirements 也存在,则请求无效。
 - 
resourceAttributes.fieldSelector.rawSelector (string) rawSelector 是字段选择算符的序列化形式,将被包含在查询参数中。 建议 Webhook 实现忽略 rawSelector。只要 requirements 不存在, kube-apiserver 的 SubjectAccessReview 将解析 rawSelector。 
 - 
resourceAttributes.fieldSelector.requirements ([]FieldSelectorRequirement) 原子:将在合并期间被替换 requirements 是字段选择算符已解析的解释。资源实例必须满足所有 requirements 才能匹配此选择算符。 Webhook 实现应处理 requirements,但如何处理由 Webhook 自行决定。 由于 requirements 只能限制请求,因此如果不理解 requirements,可以安全地将请求鉴权为无限制请求。 FieldSelectorRequirement 是一个选择算符,包含值、键以及与将键和值关联起来的运算符。 - 
resourceAttributes.fieldSelector.requirements.key (string),必需 key 是 requirements 应用到的字段选择算符键。 
- 
resourceAttributes.fieldSelector.requirements.operator (string),必需 operator 表示键与一组值之间的关系。有效的运算符有 In、NotIn、Exists、DoesNotExist。 运算符列表可能会在未来增加。 
- 
resourceAttributes.fieldSelector.requirements.values([]string) 原子:将在合并期间被替换 values 是一个字符串值的数组。如果运算符是 In 或 NotIn,则 values 数组必须非空。 如果运算符是 Exists 或 DoesNotExist,则 values 数组必须为空。 
 
- 
 
 - 
resourceAttributes.group (string) group 是资源的 API 组。 "*" 表示所有资源。 
 - 
resourceAttributes.labelSelector (LabelSelectorAttributes) labelSelector 描述基于标签的访问限制。此字段只能限制访问权限,而不能扩大访问权限。 LabelSelectorAttributes 表示通过标签限制的访问。建议 Webhook 开发者们: - 确保 rawSelector 和 requirements 未被同时设置
- 如果设置,则考虑 requirements 字段
- 如果设置,不要尝试解析或考虑 rawSelector 字段。
 这是为了避免出现另一个 CVE-2022-2880(即让不同系统以一致的方式解析为何某个查询不是我们想要的), 有关细节参见 https://www.oxeye.io/resources/golang-parameter-smuggling-attack 对于 kube-apiserver 的 SubjectAccessReview 端点: - 如果 rawSelector 为空且 requirements 为空,则请求未被限制。
- 如果 rawSelector 存在且 requirements 为空,则 rawSelector 将被解析,并在解析成功的情况下进行限制。
- 如果 rawSelector 为空且 requirements 存在,则应优先使用 requirements。
- 如果 rawSelector 存在,requirements 也存在,则请求无效。
 - 
resourceAttributes.labelSelector.rawSelector (string) rawSelector 是字段选择算符的序列化形式,将被包含在查询参数中。 建议 Webhook 实现忽略 rawSelector。只要 requirements 不存在, kube-apiserver 的 SubjectAccessReview 将解析 rawSelector。 
 - 
resourceAttributes.labelSelector.requirements ([]LabelSelectorRequirement) 原子:将在合并期间被替换 requirements 是字段选择算符已解析的解释。资源实例必须满足所有 requirements,才能匹配此选择算符。 Webhook 实现应处理 requirements,但如何处理由 Webhook 自行决定。 由于 requirements 只能限制请求,因此如果不理解 requirements,可以安全地将请求鉴权为无限制请求。 FieldSelectorRequirement 是一个选择算符,包含值、键以及将键和值关联起来的运算符。 - 
resourceAttributes.labelSelector.requirements.key (string),必需 key 是选择算符应用到的标签键。 
- 
resourceAttributes.labelSelector.requirements.operator (string),必需 operator 表示键与一组值之间的关系。有效的运算符有 In、NotIn、Exists、DoesNotExist。 
- 
resourceAttributes.labelSelector.requirements.values ([]string) 原子:将在合并期间被替换 values 是一个字符串值的数组。如果运算符是 In 或 NotIn,则 values 数组必须非空。 如果运算符是 Exists 或 DoesNotExist,则 values 数组必须为空。 此数组在策略性合并补丁(Strategic Merge Patch)期间被替换。 
 
- 
 
 - 
resourceAttributes.name (string) name 是 "get" 正在请求或 "delete" 已删除的资源。 ""(空字符串)表示所有资源。 
 - 
resourceAttributes.namespace (string) namespace 是正在请求的操作的命名空间。 目前,无命名空间和所有命名空间之间没有区别。 对于 LocalSubjectAccessReviews,默认为 ""(空字符串)。 对于集群范围的资源,默认为 ""(空字符串)。 对于来自 SubjectAccessReview 或 SelfSubjectAccessReview 的命名空间范围的资源, ""(空字符串)表示 "all"(所有资源)。 
- 
resourceAttributes.resource (string) resource 是现有的资源类别之一。 "*" 表示所有资源类别。 
- 
resourceAttributes.subresource (string) subresource 是现有的资源类别之一。 "" 表示无子资源。 
 - 
resourceAttributes.verb (string) verb 是 kubernetes 资源的 API 动作,例如 get、list、watch、create、update、delete、proxy。 "*" 表示所有动作。 
- 
resourceAttributes.version (string) version 是资源的 API 版本。 "*" 表示所有版本。 
 
- 
- 
uid (string) 有关正在请求的用户的 UID 信息。 
- 
user (string) user 是你正在测试的用户。 如果你指定 “user” 而不是 “groups”,它将被解读为“如果 user 不是任何组的成员,将会怎样”。 
SubjectAccessReviewStatus
SubjectAccessReviewStatus
- 
allowed (boolean),必需 allowed 是必需的。 如果允许该操作,则为 true,否则为 false。 
- 
denied (boolean) denied 是可选的。 如果拒绝该操作,则为 true,否则为 false。 如果 allowed 和 denied 均为 false,则 Authorizer 对是否鉴权操作没有意见。 如果 allowed 为 true,则 denied 不能为 true。 
- 
evaluationError (string) evaluationError 表示鉴权检查期间发生一些错误。 出现错误的情况下完全有可能继续确定鉴权状态。 例如,RBAC 可能缺少一个角色,但仍存在足够多的角色进行绑定,进而了解请求有关的原因。 
- 
reason (string) reason 是可选的。 它表示为什么允许或拒绝请求。 
操作
create 创建 SubjectAccessReview
HTTP 请求
POST /apis/authorization.k8s.io/v1/subjectaccessreviews
参数
- 
body: SubjectAccessReview,必需 
- 
dryRun (查询参数): string 
- 
fieldManager (查询参数): string 
- 
fieldValidation (查询参数): string 
- 
pretty (查询参数): string 
响应
200 (SubjectAccessReview): OK
201 (SubjectAccessReview): Created
202 (SubjectAccessReview): Accepted
401: Unauthorized
5 - ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
import "k8s.io/api/rbac/v1"
ClusterRole
ClusterRole 是一个集群级别的 PolicyRule 逻辑分组, 可以被 RoleBinding 或 ClusterRoleBinding 作为一个单元引用。
- 
apiVersion: rbac.authorization.k8s.io/v1 
- 
kind: ClusterRole 
- 
metadata (ObjectMeta) 标准的对象元数据。 
- 
aggregationRule (AggregationRule) aggregationRule 是一个可选字段,用于描述如何构建这个 ClusterRole 的 rules。 如果设置了 aggregationRule,则 rules 将由控制器管理,对 rules 的直接变更会被该控制器阻止。 aggregationRule 描述如何定位并聚合其它 ClusterRole 到此 ClusterRole。 - 
aggregationRule.clusterRoleSelectors ([]LabelSelector) 原子:将在合并期间被替换 clusterRoleSelectors 包含一个选择器的列表,用于查找 ClusterRole 并创建规则。 如果发现任何选择器匹配的 ClusterRole,将添加其对应的权限。 
 
- 
- 
rules ([]PolicyRule) 原子:将在合并期间被替换 rules 包含了这个 ClusterRole 的所有 PolicyRule。 PolicyRule 包含描述一个策略规则的信息,但不包含该规则适用于哪个主体或适用于哪个命名空间的信息。 - 
rules.apiGroups ([]string) 原子:将在合并期间被替换 apiGroups 是包含资源的 apiGroup 的名称。 如果指定了多个 API 组,则允许针对任何 API 组中的其中一个枚举资源来请求任何操作。 "" 表示核心 API 组,“*” 表示所有 API 组。 
- 
rules.resources ([]string) 原子:将在合并期间被替换 resources 是此规则所适用的资源的列表。“*” 表示所有资源。 
 - 
rules.verbs ([]string),必需 原子:将在合并期间被替换 verbs 是适用于此规则中所包含的所有 ResourceKinds 的动作。 “*” 表示所有动作。 
- 
rules.resourceNames ([]string) 原子:将在合并期间被替换 resourceNames 是此规则所适用的资源名称白名单,可选。 空集合意味着允许所有资源。 
- 
rules.nonResourceURLs ([]string) 原子:将在合并期间被替换 nonResourceURLs 是用户应有权访问的一组部分 URL。 允许使用 “*”,但仅能作为路径中最后一段且必须用于完整的一段, 因为非资源 URL 没有划分命名空间。 此字段仅适用于从 ClusterRoleBinding 引用的 ClusterRole。 rules 可以应用到 API 资源(如 “pod” 或 “secret”)或非资源 URL 路径(如 “/api”), 但不能同时应用于两者。 
 
- 
ClusterRoleList
ClusterRoleList 是 ClusterRole 的集合。
- 
apiVersion: rbac.authorization.k8s.io/v1 
- 
kind: ClusterRoleList 
- 
metadata (ListMeta) 标准的对象元数据。 
- 
items ([]ClusterRole),必需 items 是 ClusterRole 的列表。 
操作
get 读取指定的 ClusterRole
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}
参数
- 
name(路径参数):string,必需 ClusterRole 的名称 
- 
pretty(查询参数):string 
响应
200 (ClusterRole): OK
401: Unauthorized
list 列出或观测类别为 ClusterRole 的对象
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/clusterroles
参数
- 
allowWatchBookmarks(查询参数):boolean 
- 
continue(查询参数):string 
- 
fieldSelector(查询参数):string 
- 
labelSelector(查询参数):string 
- 
limit(查询参数):integer 
- 
pretty(查询参数):string 
- 
resourceVersion(查询参数):string 
- 
resourceVersionMatch(查询参数):string 
- 
sendInitialEvents (查询参数): boolean 
- 
timeoutSeconds(查询参数):integer 
- 
watch(查询参数):boolean 
响应
200 (ClusterRoleList): OK
401: Unauthorized
create 创建一个 ClusterRole
HTTP 请求
POST /apis/rbac.authorization.k8s.io/v1/clusterroles
参数
- 
body:ClusterRole,必需 
- 
dryRun(查询参数):string 
- 
fieldManager(查询参数):string 
- 
fieldValidation(查询参数):string 
- 
pretty(查询参数):string 
响应
200 (ClusterRole): OK
201 (ClusterRole): Created
202 (ClusterRole): Accepted
401: Unauthorized
update 替换指定的 ClusterRole
HTTP 请求
PUT /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}
参数
- 
name(路径参数):string,必需 ClusterRole 的名称 
- 
body:ClusterRole,必需 
- 
dryRun(查询参数):string 
- 
fieldManager(查询参数):string 
- 
fieldValidation(查询参数):string 
- 
pretty(查询参数):string 
响应
200 (ClusterRole): OK
201 (ClusterRole): Created
401: Unauthorized
patch 部分更新指定的 ClusterRole
HTTP 请求
PATCH /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}
参数
- 
name(路径参数):string,必需 ClusterRole 的名称 
- 
body:Patch,必需 
- 
dryRun(查询参数):string 
- 
fieldManager(查询参数):string 
- 
fieldValidation(查询参数):string 
- 
force(查询参数):boolean 
- 
pretty(查询参数):string 
响应
200 (ClusterRole): OK
201 (ClusterRole): Created
401: Unauthorized
delete 删除一个 ClusterRole
HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}
参数
- 
name(路径参数):string,必需 ClusterRole 的名称 
- 
body:DeleteOptions 
- 
dryRun(查询参数):string 
- 
gracePeriodSeconds(查询参数):integer 
- 
ignoreStoreReadErrorWithClusterBreakingPotential(查询参数):boolean 
- 
pretty(查询参数):string 
- 
propagationPolicy(查询参数):string 
响应
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection 删除 ClusterRole 的集合
HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/clusterroles
参数
- 
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
6 - 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
7 - 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) 原子:将在合并期间被替换 apiGroups 是包含资源的 apiGroup 的名称。 如果指定了多个 API 组,则允许对任何 API 组中的其中一个枚举资源来请求任何操作。 "" 表示核心 API 组,“*” 表示所有 API 组。 
- 
rules.resources ([]string) 原子:将在合并期间被替换 resources 是此规则所适用的资源的列表。 “*” 表示所有资源。 
- 
rules.verbs ([]string),必需 原子:将在合并期间被替换 verbs 是适用于此规则中所包含的所有 ResourceKinds 的动作。 “*” 表示所有动作。 
- 
rules.resourceNames ([]string) 原子:将在合并期间被替换 resourceNames 是此规则所适用的资源名称白名单,可选。 空集合意味着允许所有资源。 
- 
rules.nonResourceURLs ([]string) 原子:将在合并期间被替换 nonResourceURLs 是用户应有权访问的一组部分 URL。 允许使用 “*”,但仅能作为路径中最后一段且必须用于完整的一段, 因为非资源 URL 没有划分命名空间。 此字段仅适用于从 ClusterRoleBinding 引用的 ClusterRole。 rules 可以应用到 API 资源(如 “pod” 或 “secret”)或非资源 URL 路径(如 “/api”), 但不能同时应用于两者。 
 
- 
RoleList
RoleList 是 Role 的集合。
- 
apiVersion: rbac.authorization.k8s.io/v1 
- 
kind: RoleList 
操作
get 读取指定的 Role
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
参数
响应
200 (Role): OK
401: Unauthorized
list 列出或观测类别为 Role 的对象
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
参数
- 
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 (RoleList): OK
401: Unauthorized
list 列出或观测类别为 Role 的对象
HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/roles
参数
- 
allowWatchBookmarks(查询参数):boolean 
- 
continue(查询参数):string 
- 
fieldSelector(查询参数):string 
- 
labelSelector(查询参数):string 
- 
limit(查询参数):integer 
- 
pretty(查询参数):string 
- 
resourceVersion(查询参数):string 
- 
resourceVersionMatch(查询参数):string 
- 
sendInitialEvents (查询参数): boolean 
- 
timeoutSeconds(查询参数):integer 
- 
watch(查询参数):boolean 
响应
200 (RoleList): OK
401: Unauthorized
create 创建 Role
HTTP 请求
POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
参数
- 
namespace(路径参数):string,必需 
- 
body: Role,必需 
- 
dryRun(查询参数):string 
- 
fieldManager(查询参数):string 
- 
fieldValidation(查询参数):string 
- 
pretty(查询参数):string 
响应
200 (Role): OK
201 (Role): Created
202 (Role): Accepted
401: Unauthorized
update 替换指定的 Role
HTTP 请求
PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
参数
- 
name(路径参数):string,必需 Role 的名称 
- 
namespace(路径参数):string,必需 
- 
body: Role,必需 
- 
dryRun(查询参数):string 
- 
fieldManager(查询参数):string 
- 
fieldValidation(查询参数):string 
- 
pretty(查询参数):string 
响应
200 (Role): OK
201 (Role): Created
401: Unauthorized
patch 部分更新指定的 Role
HTTP 请求
PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
参数
- 
name(路径参数):string,必需 Role 的名称 
- 
namespace(路径参数):string,必需 
- 
body: Patch,必需 
- 
dryRun(查询参数):string 
- 
fieldManager(查询参数):string 
- 
fieldValidation(查询参数):string 
- 
force(查询参数):boolean 
- 
pretty(查询参数):string 
响应
200 (Role): OK
201 (Role): Created
401: Unauthorized
delete 删除 Role
HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
参数
- 
name(路径参数):string,必需 Role 的名称 
- 
namespace(路径参数):string,必需 
- 
body: DeleteOptions 
- 
dryRun(查询参数):string 
- 
gracePeriodSeconds(查询参数):integer 
- 
ignoreStoreReadErrorWithClusterBreakingPotential(查询参数):boolean 
- 
pretty(查询参数):string 
- 
propagationPolicy(查询参数):string 
响应
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection 删除 Role 的集合
HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
参数
- 
namespace(路径参数):string,必需 
- 
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
8 - 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 
- 
ignoreStoreReadErrorWithClusterBreakingPotential (查询参数): boolean 
- 
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 
- 
ignoreStoreReadErrorWithClusterBreakingPotential (查询参数): boolean 
- 
labelSelector (查询参数): string 
- 
limit (查询参数): integer 
- 
pretty (查询参数): string 
- 
propagationPolicy (查询参数): string 
- 
resourceVersion (查询参数): string 
- 
resourceVersionMatch (查询参数): string 
- 
sendInitialEvents (查询参数): boolean 
- 
timeoutSeconds (查询参数): integer 
响应
200 (Status): OK
401: Unauthorized