租約
apiVersion: coordination.k8s.io/v1
import "k8s.io/api/coordination/v1"
租約
租約定義了租約概念。
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 包含租約的規範。更多資訊: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
LeaseSpec
LeaseSpec 是租約的規範。
acquireTime (MicroTime)
acquireTime 是目前租約被取得的時間。
holderIdentity (字串)
holderIdentity 包含目前租約持有者的身份。如果使用協調領導者選舉,則持有者身份必須等於選出的 LeaseCandidate.metadata.name 欄位。
leaseDurationSeconds (int32)
leaseDurationSeconds 是租約候選者需要等待以強制取得租約的持續時間。這是根據上次觀察到的 renewTime 時間來衡量的。
leaseTransitions (int32)
leaseTransitions 是租約在持有者之間轉換的次數。
preferredHolder (字串)
PreferredHolder 向租約持有者發出訊號,表示租約有更佳的持有者,應放棄。只有在也設定 Strategy 時,才能設定此欄位。
renewTime (MicroTime)
renewTime 是租約的目前持有者上次更新租約的時間。
strategy (字串)
Strategy 指出用於為協調領導者選舉挑選領導者的策略。如果未指定此欄位,則此租約沒有作用中的協調。(Alpha)使用此欄位需要啟用 CoordinatedLeaderElection 功能閘道。
LeaseList
LeaseList 是租約物件的列表。
apiVersion: coordination.k8s.io/v1
kind: LeaseList
metadata (ListMeta)
標準列表 metadata。更多資訊: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]Lease), 必要
items 是 schema 物件的列表。
操作
get
讀取指定的租約
HTTP 請求
GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
參數
回應
200 (Lease): 成功
401: 未經授權
list
列出或監看租約類型的物件
HTTP 請求
GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
參數
namespace (在路徑中): 字串,必要
allowWatchBookmarks (在查詢中): 布林值
continue (在查詢中): 字串
fieldSelector (在查詢中): 字串
labelSelector (在查詢中): 字串
limit (在查詢中): 整數
pretty (在查詢中): 字串
resourceVersion (在查詢中): 字串
resourceVersionMatch (在查詢中): 字串
sendInitialEvents (在查詢中): 布林值
timeoutSeconds (在查詢中): 整數
watch (在查詢中): 布林值
回應
200 (LeaseList): 成功
401: 未經授權
list
列出或監看租約類型的物件
HTTP 請求
GET /apis/coordination.k8s.io/v1/leases
參數
allowWatchBookmarks (在查詢中): 布林值
continue (在查詢中): 字串
fieldSelector (在查詢中): 字串
labelSelector (在查詢中): 字串
limit (在查詢中): 整數
pretty (在查詢中): 字串
resourceVersion (在查詢中): 字串
resourceVersionMatch (在查詢中): 字串
sendInitialEvents (在查詢中): 布林值
timeoutSeconds (在查詢中): 整數
watch (在查詢中): 布林值
回應
200 (LeaseList): 成功
401: 未經授權
create
建立租約
HTTP 請求
POST /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
參數
namespace (在路徑中): 字串,必要
body: Lease,必要
dryRun (在查詢中): 字串
fieldManager (在查詢中): 字串
fieldValidation (在查詢中): 字串
pretty (在查詢中): 字串
回應
200 (Lease): 成功
201 (Lease): 已建立
202 (Lease): 已接受
401: 未經授權
update
取代指定的租約
HTTP 請求
PUT /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
參數
name (在路徑中): 字串,必要
租約的名稱
namespace (在路徑中): 字串,必要
body: Lease,必要
dryRun (在查詢中): 字串
fieldManager (在查詢中): 字串
fieldValidation (在查詢中): 字串
pretty (在查詢中): 字串
回應
200 (Lease): 成功
201 (Lease): 已建立
401: 未經授權
patch
部分更新指定的租約
HTTP 請求
PATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
參數
name (在路徑中): 字串,必要
租約的名稱
namespace (在路徑中): 字串,必要
body: Patch,必要
dryRun (在查詢中): 字串
fieldManager (在查詢中): 字串
fieldValidation (在查詢中): 字串
force (在查詢中): 布林值
pretty (在查詢中): 字串
回應
200 (Lease): 成功
201 (Lease): 已建立
401: 未經授權
delete
刪除租約
HTTP 請求
DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
參數
name (在路徑中): 字串,必要
租約的名稱
namespace (在路徑中): 字串,必要
body: DeleteOptions
dryRun (在查詢中): 字串
gracePeriodSeconds (在查詢中): 整數
pretty (在查詢中): 字串
propagationPolicy (查詢參數): 字串
回應
200 (Status): 成功
202 (Status): 已接受
401: 未經授權
deletecollection
刪除 Lease 集合
HTTP 請求
DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
參數
namespace (在路徑中): 字串,必要
body: DeleteOptions
continue (在查詢中): 字串
dryRun (在查詢中): 字串
fieldSelector (在查詢中): 字串
gracePeriodSeconds (在查詢中): 整數
labelSelector (在查詢中): 字串
limit (在查詢中): 整數
pretty (在查詢中): 字串
propagationPolicy (查詢參數): 字串
resourceVersion (在查詢中): 字串
resourceVersionMatch (在查詢中): 字串
sendInitialEvents (在查詢中): 布林值
timeoutSeconds (在查詢中): 整數
回應
200 (Status): 成功
401: 未經授權
此頁面為自動產生。
如果您計劃回報此頁面的問題,請在您的問題描述中提及此頁面為自動產生。此問題的修正可能需要在 Kubernetes 專案的其他地方進行。