ControllerRevision
apiVersion: apps/v1
import "k8s.io/api/apps/v1"
ControllerRevision
ControllerRevision 实现状态数据的不可变快照。客户端负责序列化和反序列化包含其内部状态的对象。一旦 ControllerRevision 成功创建,就不能更新。API Server 将拒绝所有尝试修改 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 中。(待办事项:如果对象是未知类型,将创建一个 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 是 ControllerRevision 列表
操作
get
读取指定的 ControllerRevision
HTTP 请求
GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
参数
name (在路径中): string,必需
ControllerRevision 的名称
namespace (在路径中): string,必需
pretty (在查询中): string
响应
200 (ControllerRevision): OK
401: Unauthorized
list
列出或监听 ControllerRevision 类型的对象
HTTP 请求
GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions
参数
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 (ControllerRevisionList): OK
401: Unauthorized
list
列出或监听 ControllerRevision 类型的对象
HTTP 请求
GET /apis/apps/v1/controllerrevisions
参数
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (ControllerRevisionList): OK
401: Unauthorized
create
创建一个 ControllerRevision
HTTP 请求
POST /apis/apps/v1/namespaces/{namespace}/controllerrevisions
参数
namespace (在路径中): string,必需
body: ControllerRevision,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
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,必需
body: ControllerRevision,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (ControllerRevision): OK
201 (ControllerRevision): Created
401: Unauthorized
patch
部分更新指定的 ControllerRevision
HTTP 请求
PATCH /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
参数
name (在路径中): string,必需
ControllerRevision 的名称
namespace (在路径中): string,必需
body: Patch,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): boolean
pretty (在查询中): string
响应
200 (ControllerRevision): OK
201 (ControllerRevision): Created
401: Unauthorized
delete
删除一个 ControllerRevision
HTTP 请求
DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
参数
name (在路径中): string,必需
ControllerRevision 的名称
namespace (在路径中): string,必需
body: DeleteOptions
dryRun (在查询中): string
gracePeriodSeconds (在查询中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): boolean
pretty (在查询中): string
propagationPolicy (在查询中): string
响应
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 ControllerRevision 集合
HTTP 请求
DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions
参数
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
此页面是自动生成的。
如果您打算报告此页面的问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。