ControllerRevision
apiVersion: apps/v1
import "k8s.io/api/apps/v1"
ControllerRevision
ControllerRevision 实现状态数据的不可变快照。客户端负责序列化和反序列化包含其内部状态的对象。ControllerRevision 一旦成功创建,就无法更新。API 服务器将拒绝所有尝试修改 Data 字段的请求的验证。但是,可以删除 ControllerRevision。请注意,由于 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 的字段,并在您的内部结构中使用 Object。您还需要注册各种插件类型。
// 内部包
type MyAPIObject struct { runtime.TypeMeta
json:",inline"
MyPlugin runtime.Objectjson:"myPlugin"
}type PluginA struct { AOption string
json:"aOption"
}// 外部包
type MyAPIObject struct { runtime.TypeMeta
json:",inline"
MyPlugin runtime.RawExtensionjson:"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 是一个包含 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 的列表
操作
get
读取指定的 ControllerRevision
HTTP 请求
GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
参数
响应
200 (ControllerRevision): OK
401: 未授权
list
列出或监视 ControllerRevision 类型的对象
HTTP 请求
GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions
参数
namespace (在路径中): 字符串,必需
allowWatchBookmarks (在查询中): 布尔值
continue (在查询中): 字符串
fieldSelector (在查询中): 字符串
labelSelector (在查询中): 字符串
limit (在查询中): 整数
pretty (在查询中): 字符串
resourceVersion (在查询中): 字符串
resourceVersionMatch (在查询中): 字符串
sendInitialEvents (在查询中): 布尔值
timeoutSeconds (在查询中): 整数
watch (在查询中): 布尔值
响应
200 (ControllerRevisionList): OK
401: 未授权
list
列出或监视 ControllerRevision 类型的对象
HTTP 请求
GET /apis/apps/v1/controllerrevisions
参数
allowWatchBookmarks (在查询中): 布尔值
continue (在查询中): 字符串
fieldSelector (在查询中): 字符串
labelSelector (在查询中): 字符串
limit (在查询中): 整数
pretty (在查询中): 字符串
resourceVersion (在查询中): 字符串
resourceVersionMatch (在查询中): 字符串
sendInitialEvents (在查询中): 布尔值
timeoutSeconds (在查询中): 整数
watch (在查询中): 布尔值
响应
200 (ControllerRevisionList): OK
401: 未授权
create
创建 ControllerRevision
HTTP 请求
POST /apis/apps/v1/namespaces/{namespace}/controllerrevisions
参数
namespace (在路径中): 字符串,必需
body: ControllerRevision,必需
dryRun (在查询中): 字符串
fieldManager (在查询中): 字符串
fieldValidation (在查询中): 字符串
pretty (在查询中): 字符串
响应
200 (ControllerRevision): OK
201 (ControllerRevision): 已创建
202 (ControllerRevision): 已接受
401: 未授权
update
替换指定的 ControllerRevision
HTTP 请求
PUT /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
参数
name (在路径中): 字符串,必需
ControllerRevision 的名称
namespace (在路径中): 字符串,必需
body: ControllerRevision,必需
dryRun (在查询中): 字符串
fieldManager (在查询中): 字符串
fieldValidation (在查询中): 字符串
pretty (在查询中): 字符串
响应
200 (ControllerRevision): OK
201 (ControllerRevision): 已创建
401: 未授权
patch
部分更新指定的 ControllerRevision
HTTP 请求
PATCH /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
参数
name (在路径中): 字符串,必需
ControllerRevision 的名称
namespace (在路径中): 字符串,必需
body: Patch,必需
dryRun (在查询中): 字符串
fieldManager (在查询中): 字符串
fieldValidation (在查询中): 字符串
force (在查询中): 布尔值
pretty (在查询中): 字符串
响应
200 (ControllerRevision): OK
201 (ControllerRevision): 已创建
401: 未授权
delete
删除 ControllerRevision
HTTP 请求
DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
参数
name (在路径中): 字符串,必需
ControllerRevision 的名称
namespace (在路径中): 字符串,必需
body: DeleteOptions
dryRun (在查询中): 字符串
gracePeriodSeconds (在查询中): 整数
pretty (在查询中): 字符串
propagationPolicy (在查询中): 字符串
响应
200 (Status): OK
202 (Status): 已接受
401: 未授权
deletecollection
删除 ControllerRevision 的集合
HTTP 请求
DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions
参数
namespace (在路径中): 字符串,必需
body: DeleteOptions
continue (在查询中): 字符串
dryRun (在查询中): 字符串
fieldSelector (在查询中): 字符串
gracePeriodSeconds (在查询中): 整数
labelSelector (在查询中): 字符串
limit (在查询中): 整数
pretty (在查询中): 字符串
propagationPolicy (在查询中): 字符串
resourceVersion (在查询中): 字符串
resourceVersionMatch (在查询中): 字符串
sendInitialEvents (在查询中): 布尔值
timeoutSeconds (在查询中): 整数
响应
200 (Status): OK
401: 未授权
此页面是自动生成的。
如果您计划报告此页面的问题,请在您的问题描述中提及该页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。