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)