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.name。此字段是不可变的。

  • strategy (string),必需

    Strategy 是协调领导者选举将用于挑选领导者的策略。如果同一个 Lease 的多个候选者返回不同的策略,则将使用具有最新 BinaryVersion 的候选者所提供的策略。如果仍然存在冲突,则视为用户错误,协调领导者选举将不会操作该 Lease,直到冲突解决。

  • emulationVersion (string)

    EmulationVersion 是仿真版本。它必须是 semver 格式,且不带前缀 v。EmulationVersion 必须小于或等于 BinaryVersion。当策略为 "OldestEmulationVersion" 时,此字段为必需。

  • pingTime (MicroTime)

    PingTime 是服务器最后一次请求 LeaseCandidate 进行续订的时间。这仅在领导者选举期间执行,以检查是否有任何 LeaseCandidate 变得不符合条件。当 PingTime 更新时,LeaseCandidate 将通过更新 RenewTime 来响应。

    MicroTime 是具有微秒级精度的 Time 版本。

  • renewTime (MicroTime)

    RenewTime 是 LeaseCandidate 最后一次更新的时间。每当 Lease 需要进行领导者选举时,就会更新 PingTime 字段,向 LeaseCandidate 发出信号,通知其应该更新 RenewTime。如果旧的 LeaseCandidate 对象距离上次续订已经过去了数小时,它们也会被垃圾回收。PingTime 字段会定期更新,以防止活跃的 LeaseCandidate 被垃圾回收。

    MicroTime 是具有微秒级精度的 Time 版本。

LeaseCandidateList

LeaseCandidateList 是 Lease 对象的列表。


操作


get 读取指定的 LeaseCandidate

HTTP 请求

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

Parameters

  • name (在路径中): string, 必需

    LeaseCandidate 的名称

  • namespace (在路径中): string, 必需

    命名空间

  • pretty (在查询中): string

    pretty

响应

200 (LeaseCandidate): OK

401: 未授权

list 列出或监视 LeaseCandidate 类型的对象

HTTP 请求

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

Parameters

响应

200 (LeaseCandidateList): OK

401: 未授权

list 列出或监视 LeaseCandidate 类型的对象

HTTP 请求

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

Parameters

响应

200 (LeaseCandidateList): OK

401: 未授权

create 创建一个 LeaseCandidate

HTTP 请求

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

Parameters

响应

200 (LeaseCandidate): OK

201 (LeaseCandidate): 已创建

202 (LeaseCandidate): 已接受

401: 未授权

update 替换指定的 LeaseCandidate

HTTP 请求

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

Parameters

响应

200 (LeaseCandidate): OK

201 (LeaseCandidate): 已创建

401: 未授权

patch 部分更新指定的 LeaseCandidate

HTTP 请求

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

Parameters

  • name (在路径中): string, 必需

    LeaseCandidate 的名称

  • namespace (在路径中): string, 必需

    命名空间

  • body: Patch, 必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (in query): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (LeaseCandidate): OK

201 (LeaseCandidate): 已创建

401: 未授权

delete 删除一个 LeaseCandidate

HTTP 请求

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

Parameters

响应

200 (Status): 确定

202 (Status): 已接受

401: 未授权

deletecollection 删除 LeaseCandidate 集合

HTTP 请求

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

Parameters

响应

200 (Status): 确定

401: 未授权


最后修改时间:2025年4月24日 上午9:14 PST:v1.33 的 Markdown API 参考 (b84ec30bbb)

本页面是自动生成的。

如果您打算报告此页面的问题,请在您的问题描述中提及该页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。