ControllerRevision

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 用於在外部版本中保留擴展。

    若要使用此功能,請在您的外部版本化結構中建立一個類型為 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", }, }

    那麼會發生什麼事?Decode 首先使用 json 或 yaml 將序列化資料解組到您的外部 MyAPIObject 中。這會導致原始 JSON 被儲存,但未解壓縮。下一步是複製(使用 pkg/conversion)到內部結構中。runtime 套件的 DefaultScheme 已安裝轉換函式,這些函式會解壓縮儲存在 RawExtension 中的 JSON,將其轉換為正確的物件類型,並將其儲存在 Object 中。(TODO:如果物件的類型未知,則會建立並儲存 runtime.Unknown 物件。)*

ControllerRevisionList

ControllerRevisionList 是一個資源,其中包含 ControllerRevision 物件的清單。


操作


get 讀取指定的 ControllerRevision

HTTP 請求

GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

參數

  • name (在路徑中): 字串, 必填

    ControllerRevision 的名稱

  • namespace (在路徑中): 字串, 必填

    命名空間

  • pretty (在查詢中): 字串

    pretty

回應

200 (ControllerRevision): 確定

401: 未經授權

list 列出或監看種類為 ControllerRevision 的物件

HTTP 請求

GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions

參數

回應

200 (ControllerRevisionList): 確定

401: 未經授權

list 列出或監看種類為 ControllerRevision 的物件

HTTP 請求

GET /apis/apps/v1/controllerrevisions

參數

回應

200 (ControllerRevisionList): 確定

401: 未經授權

create 建立 ControllerRevision

HTTP 請求

POST /apis/apps/v1/namespaces/{namespace}/controllerrevisions

參數

回應

200 (ControllerRevision): 確定

201 (ControllerRevision): 已建立

202 (ControllerRevision): 已接受

401: 未經授權

update 取代指定的 ControllerRevision

HTTP 請求

PUT /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

參數

回應

200 (ControllerRevision): 確定

201 (ControllerRevision): 已建立

401: 未經授權

patch 部分更新指定的 ControllerRevision

HTTP 請求

PATCH /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

參數

  • name (在路徑中): 字串, 必填

    ControllerRevision 的名稱

  • namespace (在路徑中): 字串, 必填

    命名空間

  • body: Patch, 必填

  • dryRun (在查詢中): 字串

    dryRun

  • fieldManager (在查詢中): 字串

    fieldManager

  • fieldValidation (在查詢中): 字串

    fieldValidation

  • force (在查詢中): 布林值

    force

  • pretty (在查詢中): 字串

    pretty

回應

200 (ControllerRevision): 確定

201 (ControllerRevision): 已建立

401: 未經授權

delete 刪除 ControllerRevision

HTTP 請求

DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

參數

回應

200 (Status): 確定

202 (Status): 已接受

401: 未經授權

deletecollection 刪除 ControllerRevision 的集合

HTTP 請求

DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions

參數

回應

200 (Status): 確定

401: 未經授權

此頁面為自動產生。

如果您計畫回報此頁面的問題,請在您的問題描述中提及此頁面為自動產生。修正可能需要在 Kubernetes 專案的其他地方進行。

Last modified August 28, 2024 at 6:01 PM PST: Update generated API reference for v1.31 (8ba98c79c1)