Lease
apiVersion: coordination.k8s.io/v1
import "k8s.io/api/coordination/v1"
Lease
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 是当前 Lease 被获取的时间。
holderIdentity (string)
holderIdentity 包含当前 Lease 的持有者的身份。如果使用协调领导者选举,持有者身份必须等于被选举的 LeaseCandidate.metadata.name 字段。
leaseDurationSeconds (int32)
leaseDurationSeconds 是候选者需要等待以强制获取 Lease 的时长。这是相对于上次观察到的 renewTime 测量的。
leaseTransitions (int32)
leaseTransitions 是 Lease 在持有者之间转换的次数。
preferredHolder (string)
PreferredHolder 向 Lease 持有者发出信号,该 Lease 有一个更优化的持有者,应该放弃。只有在设置 Strategy 时才能设置此字段。
renewTime (MicroTime)
renewTime 是当前 Lease 持有者上次更新 Lease 的时间。
strategy (string)
Strategy 指示协调领导者选举中选择领导者的策略。如果未指定该字段,则此 Lease 没有活动的协调。 (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), required
items 是一个模式对象列表。
操作
get 读取指定的 Lease
HTTP 请求
GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
Parameters
响应
200 (Lease): OK
401: 未授权
list 列出或监视 Lease 类型的对象
HTTP 请求
GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
Parameters
namespace (在路径中): string, 必需
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (在查询中): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
watch (in query): boolean
响应
200 (LeaseList): OK
401: 未授权
list 列出或监视 Lease 类型的对象
HTTP 请求
GET /apis/coordination.k8s.io/v1/leases
Parameters
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (在查询中): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
watch (in query): boolean
响应
200 (LeaseList): OK
401: 未授权
create 创建一个 Lease
HTTP 请求
POST /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
Parameters
namespace (在路径中): string, 必需
body: Lease, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (Lease): OK
201 (Lease): Created
202 (Lease): Accepted
401: 未授权
update 替换指定的 Lease
HTTP 请求
PUT /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
Parameters
name (在路径中): string, 必需
Lease 的名称
namespace (在路径中): string, 必需
body: Lease, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (Lease): OK
201 (Lease): Created
401: 未授权
patch 部分更新指定的 Lease
HTTP 请求
PATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
Parameters
name (在路径中): string, 必需
Lease 的名称
namespace (在路径中): string, 必需
body: Patch, 必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (in query): boolean
pretty (在查询中): string
响应
200 (Lease): OK
201 (Lease): Created
401: 未授权
delete 删除一个 Lease
HTTP 请求
DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
Parameters
name (在路径中): string, 必需
Lease 的名称
namespace (在路径中): string, 必需
body: DeleteOptions
dryRun (在查询中): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
pretty (在查询中): string
propagationPolicy (in query): string
响应
200 (Status): 确定
202 (Status): 已接受
401: 未授权
deletecollection 删除 Lease 集合
HTTP 请求
DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
Parameters
namespace (在路径中): string, 必需
body: DeleteOptions
continue (in query): string
dryRun (在查询中): string
fieldSelector (in query): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
labelSelector (in query): string
limit (in query): integer
pretty (在查询中): string
propagationPolicy (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
响应
200 (Status): 确定
401: 未授权
本页面是自动生成的。
如果您打算报告此页面的问题,请在您的问题描述中提及该页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。