LeaseCandidate v1beta1

LeaseCandidate 定义 Lease 对象的候选者。

apiVersion: coordination.k8s.io/v1beta1

import "k8s.io/api/coordination/v1beta1"

LeaseCandidate

LeaseCandidate 定义一个 Lease 对象的候选者。 通过创建候选者,协同式领导者选举能够从候选者列表中选出最佳的领导者。


  • apiVersion: coordination.k8s.io/v1beta1

  • kind: LeaseCandidate

LeaseCandidateSpec

LeaseCandidateSpec 是 Lease 的规约。


  • binaryVersion (string),必需

    binaryVersion 是可执行文件的版本。它必须采用不带前缀 v 的语义版本格式。 此字段是必需的。

  • leaseName (string),必需

    leaseName 是此候选者正在争夺的租约的名称。此字段是不可变更的。

  • strategy (string),必需

    strategy 是协调式领导者选举中用于选择领导者的策略。 如果多个候选者针对同一个 Lease 返回了不同的策略,则将采用 binaryVersion 最新的候选者所提供的策略。 如果仍存在冲突,则视为用户错误,协调式领导者选举将不会继续操作此 Lease,直到冲突被解决。

  • emulationVersion (string)

    emulationVersion 是仿真版本。它必须采用不带前缀 v 的语义版本格式。 emulationVersion 必须小于或等于 binaryVersion。 当策略为 "OldestEmulationVersion" 时,此字段是必需的。

pingTime 是服务器最近一次请求 LeaseCandidate 续订的时间。 此操作仅在领导者选举期间进行,用以检查是否有 LeaseCandidates 变得不合格。 当 pingTime 更新时,LeaseCandidate 会通过更新 renewTime 来响应。

MicroTime 是微秒级精度的 Time 版本

  • renewTime (MicroTime)

    renewTime 是 LeaseCandidate 被最近一次更新的时间。每当 Lease 需要进行领导者选举时, pingTime 字段会被更新,以向 LeaseCandidate 发出应更新 renewTime 的信号。 如果自上次续订以来已经过去几个小时,旧的 LeaseCandidate 对象也会被垃圾收集。 pingTime 字段会被定期更新,以防止对仍处于活动状态的 LeaseCandidates 进行垃圾收集。

    MicroTime 是微秒级精度的 Time 版本

LeaseCandidateList

LeaseCandidateList 是 Lease 对象的列表。


  • apiVersion: coordination.k8s.io/v1beta1

  • kind: LeaseCandidateList

操作


get 读取指定的 LeaseCandidate

HTTP 请求

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

参数

  • name (路径参数): string,必需

    LeaseCandidate 的名称。

  • namespace (路径参数): string,必需

    namespace

  • pretty (查询参数): string

    pretty

响应

200 (LeaseCandidate): OK

401: Unauthorized

list 列举或监视类别为 LeaseCandidate 的对象

HTTP 请求

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

参数

响应

200 (LeaseCandidateList): OK

401: Unauthorized

list 列举或监视类别为 LeaseCandidate 的对象

HTTP 请求

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

参数

响应

200 (LeaseCandidateList): OK

401: Unauthorized

create 创建 LeaseCandidate

HTTP 请求

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

参数

响应

200 (LeaseCandidate): OK

201 (LeaseCandidate): Created

202 (LeaseCandidate): Accepted

401: Unauthorized

update 替换指定的 LeaseCandidate

HTTP 请求

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

参数

  • name (路径参数): string,必需

    LeaseCandidate 的名称。

  • namespace (路径参数): string,必需

    namespace

  • body: LeaseCandidate,必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • pretty (查询参数): string

    pretty

响应

200 (LeaseCandidate): OK

201 (LeaseCandidate): Created

401: Unauthorized

patch 部分更新指定的 LeaseCandidate

HTTP 请求

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

参数

  • name (路径参数): string,必需

    LeaseCandidate 的名称。

  • namespace (路径参数): string,必需

    namespace

  • body: Patch,必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • force (查询参数): boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (LeaseCandidate): OK

201 (LeaseCandidate): Created

401: Unauthorized

delete 删除 LeaseCandidate

HTTP 请求

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

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 LeaseCandidate 的集合

HTTP 请求

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

参数

响应

200 (Status): OK

401: Unauthorized

最后修改 April 25, 2025 at 9:03 AM PST: [zh] Sync lease-candidate-v1beta1.md (965205e83f)