LeaseCandidate v1beta1

LeaseCandidate 定義了 Lease 物件的候選者。

apiVersion: coordination.k8s.io/v1beta1

import "k8s.io/api/coordination/v1beta1"

LeaseCandidate

LeaseCandidate 定義了 Lease 物件的候選者。建立候選者的目的是為了讓協調式領導者選舉從候選者列表中選出最佳領導者。


LeaseCandidateSpec

LeaseCandidateSpec 是 Lease 的規範。


  • binaryVersion (string),必需

    BinaryVersion 是二進位制版本。它必須是 semver 格式,不帶前導 v。此欄位是必需的。

  • leaseName (string),必需

    LeaseName 是此候選者所競爭的 Lease 的名稱。此欄位的限制與 Lease.name 的限制相同。多個 Lease 候選者可以引用相同的 Lease.name。此欄位是不可變的。

  • strategy (string),必需

    Strategy 是協調式領導者選舉將用於選擇領導者的策略。如果同一 Lease 的多個候選者返回不同的策略,則將使用具有最新 BinaryVersion 的候選者提供的策略。如果仍然存在衝突,則這是一個使用者錯誤,協調式領導者選舉將不會操作 Lease,直到問題解決。

  • emulationVersion (string)

    EmulationVersion 是模擬版本。它必須是 semver 格式,不帶前導 v。EmulationVersion 必須小於或等於 BinaryVersion。當 strategy 為 "OldestEmulationVersion" 時,此欄位是必需的。

  • pingTime (MicroTime)

    PingTime 是伺服器要求 LeaseCandidate 續訂的最後時間。它僅在領導者選舉期間執行,以檢查是否有任何 LeaseCandidate 變得不合格。當 PingTime 更新時,LeaseCandidate 將透過更新 RenewTime 來響應。

    MicroTime 是精確到微秒級別的時間版本。

  • renewTime (MicroTime)

    RenewTime 是 LeaseCandidate 最後更新的時間。任何時候 Lease 需要進行領導者選舉,PingTime 欄位都會更新,以向 LeaseCandidate 發出訊號,表示它們應該更新 RenewTime。如果自上次續訂以來已過去數小時,舊的 LeaseCandidate 物件也將被垃圾回收。PingTime 欄位會定期更新,以防止仍在活動的 LeaseCandidate 被垃圾回收。

    MicroTime 是精確到微秒級別的時間版本。

LeaseCandidateList

LeaseCandidateList 是 Lease 物件的列表。


操作


get 讀取指定的 LeaseCandidate

HTTP 請求

GET /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}

引數

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

    LeaseCandidate 的名稱

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

    名稱空間

  • pretty (在查詢中): string

    pretty

響應

200 (LeaseCandidate): 確定

401: 未授權

list 列出或監視 LeaseCandidate 型別的物件

HTTP 請求

GET /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates

引數

響應

200 (LeaseCandidateList): 確定

401: 未授權

list 列出或監視 LeaseCandidate 型別的物件

HTTP 請求

GET /apis/coordination.k8s.io/v1beta1/leasecandidates

引數

響應

200 (LeaseCandidateList): 確定

401: 未授權

create 建立一個 LeaseCandidate

HTTP 請求

POST /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates

引數

響應

200 (LeaseCandidate): 確定

201 (LeaseCandidate): 已建立

202 (LeaseCandidate): 已接受

401: 未授權

update 替換指定的 LeaseCandidate

HTTP 請求

PUT /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}

引數

響應

200 (LeaseCandidate): 確定

201 (LeaseCandidate): 已建立

401: 未授權

patch 部分更新指定的 LeaseCandidate

HTTP 請求

PATCH /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}

引數

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

    LeaseCandidate 的名稱

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

    名稱空間

  • body: Patch,必需

  • dryRun (在查詢中): string

    dryRun

  • fieldManager (在查詢中): string

    fieldManager

  • fieldValidation (在查詢中): string

    fieldValidation

  • force (在查詢中): boolean

    force

  • pretty (在查詢中): string

    pretty

響應

200 (LeaseCandidate): 確定

201 (LeaseCandidate): 已建立

401: 未授權

delete 刪除一個 LeaseCandidate

HTTP 請求

DELETE /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}

引數

響應

200 (Status): OK

202 (Status): 已接受

401: 未授權

deletecollection 刪除 LeaseCandidate 集合

HTTP 請求

DELETE /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates

引數

響應

200 (Status): OK

401: 未授權

本頁面是自動生成的。

如果你打算報告此頁面存在的問題,請在問題描述中提及此頁面是自動生成的。修復可能需要在 Kubernetes 專案的其他地方進行。

最後修改時間:2025 年 4 月 24 日上午 9:14 PST:v1.33 的 Markdown API 參考 (b84ec30bbb)