Lease

Lease 定义了租约的概念。

apiVersion: coordination.k8s.io/v1

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

Lease

Lease 定义了租约的概念。


LeaseSpec

LeaseSpec 是一个 Lease 的规约。


  • acquireTime (MicroTime)

    acquireTime 是当前租约被获取的时间。

    MicroTime 是微秒级精确时间的版本。

  • holderIdentity (string)

    holderIdentity 包含当前租约持有人的身份。

  • leaseDurationSeconds (int32)

    leaseDurationSeconds 是租约候选人需要等待强制获取租约的持续时间。这是相对于上次观察到的 renewTime 的度量。

  • leaseTransitions (int32)

    leaseTransitions 是租约持有人之间的转换次数。

  • renewTime (MicroTime)

    renewTime 是当前租约持有人上次更新租约的时间。

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

LeaseList

LeaseList 是 Lease 对象的列表。


操作


get 读取指定的 Lease

HTTP 请求

GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

参数

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

    Lease 名称。

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

    namespace

  • pretty (查询参数): string

    pretty

响应

200 (Lease): OK

401: Unauthorized

list 列出或监视 Lease 类对象

HTTP 请求

GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases

参数

响应

200 (LeaseList): OK

401: Unauthorized

list 列出或监视 Lease 类对象

HTTP 请求

GET /apis/coordination.k8s.io/v1/leases

参数

响应

200 (LeaseList): OK

401: Unauthorized

create 创建 Lease

HTTP 请求

POST /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases

参数

响应

200 (Lease): OK

201 (Lease): Created

202 (Lease): Accepted

401: Unauthorized

update 替换指定的 Lease

HTTP 请求

PUT /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

参数

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

    Lease 的名称。

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

    namespace

  • body: Lease, 必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • pretty (查询参数): string

    pretty

响应

200 (Lease): OK

201 (Lease): Created

401: Unauthorized

patch 部分更新指定的 Lease

HTTP 请求

PATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

参数

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

    Lease 的名称。

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

    namespace

  • body: Patch, 必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • force (查询参数): boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (Lease): OK

201 (Lease): Created

401: Unauthorized

delete 删除一个 Lease

HTTP 请求

DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Lease 收款

HTTP 请求

DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases

参数

响应

200 (Status): OK

401: Unauthorized

最后修改 April 18, 2023 at 1:51 PM PST: [zh] sync /kubernetes-api/cluster-resources/lease-v1.md (ea3440dca9)