website/content/zh-cn/docs/reference/kubernetes-api/cluster-resources/lease-candidate-v1beta1.md

30 KiB
Raw Blame History

api_metadata content_type description title weight
apiVersion import kind
coordination.k8s.io/v1beta1 k8s.io/api/coordination/v1beta1 LeaseCandidate
api_reference LeaseCandidate 定义 Lease 对象的候选者。 LeaseCandidate v1beta1 6

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必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidate" >}}">LeaseCandidate): OK

401: Unauthorized

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

HTTP 请求

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

参数

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

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • allowWatchBookmarks (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks

  • continue (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • fieldSelector (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • labelSelector (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • resourceVersion (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • sendInitialEvents (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents

  • timeoutSeconds (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

  • watch (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch

响应

200 (<a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidateList" >}}">LeaseCandidateList): OK

401: Unauthorized

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

HTTP 请求

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

参数

  • allowWatchBookmarks (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks

  • continue (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • fieldSelector (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • labelSelector (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • resourceVersion (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • sendInitialEvents (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents

  • timeoutSeconds (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

  • watch (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch

响应

200 (<a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidateList" >}}">LeaseCandidateList): OK

401: Unauthorized

create 创建 LeaseCandidate

HTTP 请求

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

参数

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

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidate" >}}">LeaseCandidate必需

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidate" >}}">LeaseCandidate): OK

201 (<a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidate" >}}">LeaseCandidate): Created

202 (<a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidate" >}}">LeaseCandidate): Accepted

401: Unauthorized

update 替换指定的 LeaseCandidate

HTTP 请求

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

参数

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

    LeaseCandidate 的名称。

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

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidate" >}}">LeaseCandidate必需

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidate" >}}">LeaseCandidate): OK

201 (<a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidate" >}}">LeaseCandidate): Created

401: Unauthorized

patch 部分更新指定的 LeaseCandidate

HTTP 请求

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

参数

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

    LeaseCandidate 的名称。

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

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch必需

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • force (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#force" >}}">force

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidate" >}}">LeaseCandidate): OK

201 (<a href="{{< ref "../cluster-resources/lease-candidate-v1beta1#LeaseCandidate" >}}">LeaseCandidate): Created

401: Unauthorized

delete 删除 LeaseCandidate

HTTP 请求

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

参数

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

    LeaseCandidate 的名称。

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

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • gracePeriodSeconds (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds

  • ignoreStoreReadErrorWithClusterBreakingPotential (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#ignoreStoreReadErrorWithClusterBreakingPotential" >}}">ignoreStoreReadErrorWithClusterBreakingPotential

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • propagationPolicy (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy

响应

200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): OK

202 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): Accepted

401: Unauthorized

deletecollection 删除 LeaseCandidate 的集合

HTTP 请求

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

参数

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

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions

  • continue (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldSelector (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • gracePeriodSeconds (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds

  • ignoreStoreReadErrorWithClusterBreakingPotential (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#ignoreStoreReadErrorWithClusterBreakingPotential" >}}">ignoreStoreReadErrorWithClusterBreakingPotential

  • labelSelector (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • propagationPolicy (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy

  • resourceVersion (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • sendInitialEvents (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents

  • timeoutSeconds (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

响应

200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): OK

401: Unauthorized