diff --git a/content/zh/docs/reference/kubernetes-api/workload-resources/controller-revision-v1.md b/content/zh/docs/reference/kubernetes-api/workload-resources/controller-revision-v1.md new file mode 100644 index 00000000000..d29eda09df6 --- /dev/null +++ b/content/zh/docs/reference/kubernetes-api/workload-resources/controller-revision-v1.md @@ -0,0 +1,1069 @@ +--- +api_metadata: + apiVersion: "apps/v1" + import: "k8s.io/api/apps/v1" + kind: "ControllerRevision" +content_type: "api_reference" +description: "ControllerRevision 实现了状态数据的不可变快照。" +title: "ControllerRevision" +weight: 7 +auto_generated: false +--- + + + + +`apiVersion: apps/v1` + +`import "k8s.io/api/apps/v1"` + + +## ControllerRevision {#ControllerRevision} + + +ControllerRevision 实现了状态数据的不可变快照。 +客户端负责序列化和反序列化对象,包含对象内部状态。 +成功创建 ControllerRevision 后,将无法对其进行更新。 +API 服务器将无法成功验证所有尝试改变 data 字段的请求。 +但是,可以删除 ControllerRevisions。 +请注意,由于 DaemonSet 和 StatefulSet 控制器都使用它来进行更新和回滚,所以这个对象是 beta 版。 +但是,它可能会在未来版本中更改名称和表示形式,客户不应依赖其稳定性。 +它主要供控制器内部使用。 + +
+ + +- **apiVersion**: apps/v1 + + +- **kind**: ControllerRevision + + +- **metadata** (}}">ObjectMeta) + + 标准的对象元数据。 + 更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + + +- **revision** (int64),必需 + + revision 表示 data 表示的状态的修订。 + + +- **data** (RawExtension) + + data 是状态的序列化表示。 + + + + *RawExtension 用于以外部版本来保存扩展数据。 + + + 要使用它,请生成一个字段,在外部、版本化结构中以 RawExtension 作为其类型,在内部结构中以 Object 作为其类型。 + + + // 内部包: + type MyAPIObject struct { + runtime.TypeMeta `json:",inline"` + MyPlugin runtime.Object `json:"myPlugin"` + } + type PluginA struct { + AOption string `json:"aOption"` + } + + + // 外部包: + type MyAPIObject struct { + runtime.TypeMeta `json:",inline"` + MyPlugin runtime.RawExtension `json:"myPlugin"` + } + type PluginA struct { + AOption string `json:"aOption"` + } + + + // 在网络上,JSON 看起来像这样: + { + "kind":"MyAPIObject", + "apiVersion":"v1", + "myPlugin": { + "kind":"PluginA", + "aOption":"foo", + }, + } + + + 那么会发生什么? + 解码首先使用 json 或 yaml 将序列化数据解组到你的外部 MyAPIObject 中。 + 这会导致原始 JSON 被存储下来,但不会被解包。 + 下一步是复制(使用 pkg/conversion)到内部结构中。 + runtime 包的 DefaultScheme 安装了转换函数,它将解析存储在 RawExtension 中的 JSON, + 将其转换为正确的对象类型,并将其存储在 Object 中。 + (TODO:如果对象是未知类型,将创建并存储一个 `runtime.Unknown`对象。)* + + +## ControllerRevisionList {#ControllerRevisionList} + +ControllerRevisionList 是一个包含 ControllerRevision 对象列表的资源。 + +
+ + +- **apiVersion**: apps/v1 + + +- **kind**: ControllerRevisionList + + +- **metadata** (}}">ListMeta) + + 更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + + +- **items** ([]}}">ControllerRevision),必需 + + items 是 ControllerRevisions 的列表 + + +## 操作 {#Operations} + +
+ + +### `get` 读取特定的 ControllerRevision + + +#### HTTP 请求 + +GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name} + + +#### 参数 + + +- **name** (**路径参数**):string,必需 + + ControllerRevision 的名称 + + +- **namespace** (**路径参数**):string,必需 + + }}">namespace + + +- **pretty** (**查询参数**):string + + }}">pretty + + +#### 响应 + + +200 (}}">ControllerRevision): OK + +401: Unauthorized + + +### `list` 列出或监视 ControllerRevision 类别的对象 + + +#### HTTP 请求 + +GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions + + +#### 参数 + + +- **namespace** (**路径参数**):string,必需 + + }}">namespace + + +- **allowWatchBookmarks** (**查询参数**): boolean + + }}">allowWatchBookmarks + + +- **continue** (**查询参数**):string + + }}">continue + + +- **fieldSelector** (**查询参数**):string + + }}">fieldSelector + + +- **labelSelector** (**查询参数**):string + + }}">labelSelector + + +- **limit** (**查询参数**)): integer + + }}">limit + + +- **pretty** (**查询参数**):string + + }}">pretty + + +- **resourceVersion** (**查询参数**):string + + }}">resourceVersion + + +- **resourceVersionMatch** (**查询参数**):string + + }}">resourceVersionMatch + + +- **timeoutSeconds** (**查询参数**): integer + + }}">timeoutSeconds + + +- **watch** (**查询参数**): boolean + + }}">watch + + +#### 响应 + +200 (}}">ControllerRevisionList): OK + +401: Unauthorized + + +### `list` 列出或监视 ControllerRevision 类别的对象 + + +#### HTTP 请求 + +GET /apis/apps/v1/controllerrevisions + + +#### 参数 + + +- **allowWatchBookmarks** (**查询参数**): boolean + + }}">allowWatchBookmarks + + +- **continue** (**查询参数**):string + + }}">continue + + +- **fieldSelector** (**查询参数**):string + + }}">fieldSelector + + +- **labelSelector** (**查询参数**):string + + }}">labelSelector + + +- **limit** (**查询参数**): integer + + }}">limit + + +- **pretty** (**查询参数**):string + + }}">pretty + + +- **resourceVersion** (**查询参数**):string + + }}">resourceVersion + + +- **resourceVersionMatch** (**查询参数**):string + + }}">resourceVersionMatch + + +- **timeoutSeconds** (**查询参数**): integer + + }}">timeoutSeconds + + +- **watch** (**查询参数**): boolean + + }}">watch + + +#### 响应 + +200 (}}">ControllerRevisionList): OK + +401: Unauthorized + + +### `create` 创建一个 ControllerRevision + + +#### HTTP 请求 + +POST /apis/apps/v1/namespaces/{namespace}/controllerrevisions + + +#### 参数 + + +- **namespace** (**路径参数**):string,必需 + + }}">namespace + + +- **body**: }}">ControllerRevision,必需 + + +- **dryRun** (**查询参数**):string + + }}">dryRun + + +- **fieldManager** (**查询参数**):string + + }}">fieldManager + + +- **fieldValidation** (**查询参数**):string + + }}">fieldValidation + + +- **pretty** (**查询参数**):string + + }}">pretty + + +#### 响应 + +200 (}}">ControllerRevision): OK + +201 (}}">ControllerRevision): Created + +202 (}}">ControllerRevision): Accepted + +401: Unauthorized + + +### `update` 替换特定的 ControllerRevision + + +#### HTTP 参数 + +PUT /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name} + + +#### 参数 + + +- **name** (**路径参数**):string,必需 + + ControllerRevision 的名称 + + +- **namespace** (**路径参数**):string,必需 + + }}">namespace + + +- **body**: }}">ControllerRevision,必需 + + +- **dryRun** (**查询参数**):string + + }}">dryRun + + +- **fieldManager** (**查询参数**):string + + }}">fieldManager + + +- **fieldValidation** (**查询参数**):string + + }}">fieldValidation + + +- **pretty** (**查询参数**):string + + }}">pretty + + + +#### 响应 + +200 (}}">ControllerRevision): OK + +201 (}}">ControllerRevision): Created + +401: Unauthorized + + +### `patch` 部分更新特定的 ControllerRevision + + +#### HTTP 请求 + +PATCH /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name} + + +#### 参数 + + +- **name** (**路径参数**):string,必需 + + ControllerRevision 的名称 + + +- **namespace** (**路径参数**):string,必需 + + }}">namespace + + +- **body**: }}">Patch,必需 + + +- **dryRun** (**查询参数**):string + + }}">dryRun + + +- **fieldManager** (**查询参数**):string + + }}">fieldManager + + +- **fieldValidation** (**查询参数**):string + + }}">fieldValidation + + +- **force** (**查询参数**): boolean + + }}">force + + +- **pretty** (**查询参数**):string + + }}">pretty + + + +#### 响应 + +200 (}}">ControllerRevision): OK + +201 (}}">ControllerRevision): Created + +401: Unauthorized + + +### `delete` 删除一个 ControllerRevision + + +#### HTTP 请求 + +DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name} + + +#### 参数 + + +- **name** (**路径参数**):string,必需 + + ControllerRevision 的名称 + + +- **namespace** (**路径参数**):string,必需 + + }}">namespace + + +- **body**: }}">DeleteOptions + + +- **dryRun** (**查询参数**):string + + }}">dryRun + + +- **gracePeriodSeconds** (**查询参数**): integer + + }}">gracePeriodSeconds + + +- **pretty** (**查询参数**):string + + }}">pretty + + +- **propagationPolicy** (**查询参数**):string + + }}">propagationPolicy + + + +#### 响应 + +200 (}}">Status): OK + +202 (}}">Status): Accepted + +401: Unauthorized + + +### `deletecollection` 删除 ControllerRevision 集合 + + +#### HTTP 请求 + +DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions + + +#### 参数 + + +- **namespace** (**路径参数**):string,必需 + + }}">namespace + + +- **body**: }}">DeleteOptions + + +- **continue** (**查询参数**):string + + }}">continue + + +- **dryRun** (**查询参数**):string + + }}">dryRun + + +- **fieldSelector** (**查询参数**):string + + }}">fieldSelector + + +- **gracePeriodSeconds** (**查询参数**): integer + + }}">gracePeriodSeconds + + +- **labelSelector** (**查询参数**):string + + }}">labelSelector + + +- **limit** (**查询参数**): integer + + }}">limit + + +- **pretty** (**查询参数**):string + + }}">pretty + + +- **propagationPolicy** (**查询参数**):string + + }}">propagationPolicy + + +- **resourceVersion** (**查询参数**):string + + }}">resourceVersion + + +- **resourceVersionMatch** (**查询参数**):string + + }}">resourceVersionMatch + + +- **timeoutSeconds** (**查询参数**): integer + + }}">timeoutSeconds + + + +#### 响应 + +200 (}}">Status): OK + +401: Unauthorized +