ControllerRevision
apiVersion: apps/v1
import "k8s.io/api/apps/v1"
ControllerRevision
ControllerRevision 實現了狀態資料的不可變快照。客戶端負責序列化和反序列化包含其內部狀態的物件。ControllerRevision 一旦成功建立,就不能更新。API Server 將拒絕所有嘗試修改 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 的欄位,並在您的內部結構中建立一個 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", }, }
那麼會發生什麼?首先,Decode 使用 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 是 ControllerRevisions 的列表
操作
get
讀取指定的 ControllerRevision
HTTP 請求
GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
引數
name (在路徑中): string,必填
ControllerRevision 的名稱
namespace (在路徑中): string,必填
pretty (在查詢中): string
響應
200 (ControllerRevision): OK
401: 未授權
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: 未授權
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: 未授權
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): 已建立
202 (ControllerRevision): 已接受
401: 未授權
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): 已建立
401: 未授權
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): 已建立
401: 未授權
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): 已接受
401: 未授權
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: 未授權
本頁面是自動生成的。
如果你打算報告此頁面存在的問題,請在問題描述中提及此頁面是自動生成的。修復可能需要在 Kubernetes 專案的其他地方進行。