×
描述

PodSecurityPolicyReview 检查哪些服务帐户(而不是用户,因为这将是集群范围的)可以创建相关的PodTemplateSpec

兼容性级别 2:在主要版本中至少稳定 9 个月或 3 个次要版本(以较长者为准)。

类型

对象

必需
  • spec

规格

属性 类型 描述

apiVersion

字符串

APIVersion 定义了此对象表示的版本化模式。服务器应将识别的模式转换为最新的内部值,并可能拒绝无法识别的值。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

kind

字符串

Kind 是一个字符串值,表示此对象表示的 REST 资源。服务器可以从客户端提交请求的端点推断出这一点。不能更新。使用驼峰命名法。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

spec

对象

PodSecurityPolicyReviewSpec 定义了 PodSecurityPolicyReview 的规范

status

对象

PodSecurityPolicyReviewStatus 表示 PodSecurityPolicyReview 的状态。

.spec

描述

PodSecurityPolicyReviewSpec 定义了 PodSecurityPolicyReview 的规范

类型

对象

必需
  • template

属性 类型 描述

serviceAccountNames

数组(字符串)

serviceAccountNames 是一个可选的服务帐户集合,用于运行检查。如果 serviceAccountNames 为空,则使用 template.spec.serviceAccountName,除非它为空,否则使用“default”。如果指定了 serviceAccountNames,则忽略 template.spec.serviceAccountName。

template

PodTemplateSpec

template 是要检查的 PodTemplateSpec。如果 serviceAccountNames 为空,则使用 template.spec.serviceAccountName 字段,除非 template.spec.serviceAccountName 为空,否则使用“default”。如果指定了 serviceAccountNames,则忽略 template.spec.serviceAccountName。

.status

描述

PodSecurityPolicyReviewStatus 表示 PodSecurityPolicyReview 的状态。

类型

对象

必需
  • allowedServiceAccounts

属性 类型 描述

allowedServiceAccounts

数组

allowedServiceAccounts 返回具有创建 PodTemplateSpec 权限的**此**命名空间中的服务帐户列表。

allowedServiceAccounts[]

对象

ServiceAccountPodSecurityPolicyReviewStatus 表示服务帐户名称和相关的审核状态

.status.allowedServiceAccounts

描述

allowedServiceAccounts 返回具有创建 PodTemplateSpec 权限的**此**命名空间中的服务帐户列表。

类型

数组

.status.allowedServiceAccounts[]

描述

ServiceAccountPodSecurityPolicyReviewStatus 表示服务帐户名称和相关的审核状态

类型

对象

必需
  • name

属性 类型 描述

allowedBy

ObjectReference

allowedBy 是允许 PodTemplateSpec 的规则的引用。规则可以是 SecurityContextConstraint 或 PodSecurityPolicy nil 表示它被拒绝。

name

字符串

name 包含允许和拒绝的服务帐户名称

reason

字符串

此操作处于“失败”状态的机器可读描述。如果此值为空,则没有可用信息。

template

PodTemplateSpec

template 是应用默认值后的 PodTemplateSpec。

API 端点

提供以下 API 端点

  • /apis/security.openshift.io/v1/namespaces/{namespace}/podsecuritypolicyreviews

    • POST:创建 PodSecurityPolicyReview

/apis/security.openshift.io/v1/namespaces/{namespace}/podsecuritypolicyreviews

表 1. 全局查询参数
参数 类型 描述

dryRun

字符串

如果存在,则表示不应持久化修改。无效或无法识别的 dryRun 指令将导致错误响应,并且不会进一步处理请求。有效值为:- All:将处理所有 dry run 阶段

fieldValidation

字符串

fieldValidation 指示服务器如何处理请求 (POST/PUT/PATCH) 中包含未知或重复字段的对象。有效值为:- Ignore:这将忽略任何被对象静默丢弃的未知字段,并将忽略解码器遇到的最后一个重复字段以外的所有重复字段。这是 v1.23 之前的默认行为。- Warn:这将通过标准警告响应标头为每个从对象中删除的未知字段和遇到的每个重复字段发送警告。如果没有任何其他错误,请求仍然会成功,并且只会持久化任何重复字段中的最后一个。这是 v1.23+ 的默认值 - Strict:如果任何未知字段将从对象中删除,或者存在任何重复字段,这将使请求失败并返回 BadRequest 错误。服务器返回的错误将包含遇到的所有未知和重复字段。

HTTP 方法

POST

描述

创建 PodSecurityPolicyReview

表 2. 主体参数
参数 类型 描述

body

PodSecurityPolicyReview 模式

表 3. HTTP 响应
HTTP 代码 响应主体

200 - OK

PodSecurityPolicyReview 模式

201 - 已创建

PodSecurityPolicyReview 模式

202 - 已接受

PodSecurityPolicyReview 模式

401 - 未授权