Lease
apiVersion: coordination.k8s.io/v1
import "k8s.io/api/coordination/v1"
Lease
Lease 定義了一個租約概念。
apiVersion: coordination.k8s.io/v1
kind: Lease
metadata (ObjectMeta)
更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (LeaseSpec)
spec 包含 Lease 的規範。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
LeaseSpec
LeaseSpec 是 Lease 的一個規範。
acquireTime (MicroTime)
acquireTime 是當前租約被獲取的時間。
holderIdentity (string)
holderIdentity 包含當前租約持有者的身份。如果使用協調式領導者選舉,持有者身份必須等於當選的 LeaseCandidate.metadata.name 欄位。
leaseDurationSeconds (int32)
leaseDurationSeconds 是租約候選者強制獲取租約需要等待的持續時間。這是根據上次觀察到的 renewTime 計算的。
leaseTransitions (int32)
leaseTransitions 是租約在持有者之間轉換的次數。
preferredHolder (string)
PreferredHolder 向租約持有者發出訊號,表明租約有一個更優的持有者,應該放棄。此欄位只能在 Strategy 也已設定時設定。
renewTime (MicroTime)
renewTime 是當前租約持有者最後一次更新租約的時間。
strategy (string)
Strategy 指示協調式領導者選舉中選擇領導者的策略。如果未指定此欄位,則此租約沒有活躍的協調。(Alpha)使用此欄位需要啟用 CoordinatedLeaderElection 功能門控。
LeaseList
LeaseList 是 Lease 物件的列表。
apiVersion: coordination.k8s.io/v1
kind: LeaseList
metadata (ListMeta)
標準列表元資料。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]Lease), 必填
items 是 schema 物件的列表。
操作
get
讀取指定的 Lease
HTTP 請求
GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
引數
響應
200 (Lease): 成功
401: 未授權
list
列出或監視型別為 Lease 的物件
HTTP 請求
GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
引數
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 (LeaseList): 成功
401: 未授權
list
列出或監視型別為 Lease 的物件
HTTP 請求
GET /apis/coordination.k8s.io/v1/leases
引數
allowWatchBookmarks (在查詢中): boolean
continue (在查詢中): string
fieldSelector (在查詢中): string
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
watch (在查詢中): boolean
響應
200 (LeaseList): 成功
401: 未授權
create
建立一個 Lease
HTTP 請求
POST /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
引數
namespace (在路徑中): string,必填
body: Lease, 必填
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (Lease): 成功
201 (Lease): 已建立
202 (Lease): 已接受
401: 未授權
update
替換指定的 Lease
HTTP 請求
PUT /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
引數
name (在路徑中): string,必填
Lease 的名稱
namespace (在路徑中): string,必填
body: Lease, 必填
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (Lease): 成功
201 (Lease): 已建立
401: 未授權
patch
部分更新指定的 Lease
HTTP 請求
PATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
引數
name (在路徑中): string,必填
Lease 的名稱
namespace (在路徑中): string,必填
body: Patch,必需
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
force (在查詢中): boolean
pretty (在查詢中): string
響應
200 (Lease): 成功
201 (Lease): 已建立
401: 未授權
delete
刪除一個 Lease
HTTP 請求
DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
引數
name (在路徑中): string,必填
Lease 的名稱
namespace (在路徑中): string,必填
body: DeleteOptions
dryRun (在查詢中): string
gracePeriodSeconds (在查詢中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查詢中): boolean
pretty (在查詢中): string
propagationPolicy (在查詢中): string
響應
200 (Status): OK
202 (Status): 已接受
401: 未授權
deletecollection
刪除 Lease 集合
HTTP 請求
DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
引數
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 專案的其他地方進行。