LeaseCandidate v1beta1
apiVersion: coordination.k8s.io/v1beta1
import "k8s.io/api/coordination/v1beta1"
LeaseCandidate
LeaseCandidate 定义一个 Lease 对象的候选者。 通过创建候选者,协同式领导者选举能够从候选者列表中选出最佳的领导者。
apiVersion: coordination.k8s.io/v1beta1
kind: LeaseCandidate
metadata (ObjectMeta)
更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (LeaseCandidateSpec)
spec 包含 Lease 的规约。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
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 来响应。
renewTime (MicroTime)
renewTime 是 LeaseCandidate 被最近一次更新的时间。每当 Lease 需要进行领导者选举时, pingTime 字段会被更新,以向 LeaseCandidate 发出应更新 renewTime 的信号。 如果自上次续订以来已经过去几个小时,旧的 LeaseCandidate 对象也会被垃圾收集。 pingTime 字段会被定期更新,以防止对仍处于活动状态的 LeaseCandidates 进行垃圾收集。
LeaseCandidateList
LeaseCandidateList 是 Lease 对象的列表。
apiVersion: coordination.k8s.io/v1beta1
kind: LeaseCandidateList
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]LeaseCandidate),必需
items 是模式对象的列表。
操作
get 读取指定的 LeaseCandidate
HTTP 请求
GET /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}
参数
name (路径参数): string,必需
LeaseCandidate 的名称。
namespace (路径参数): string,必需
pretty (查询参数): string
响应
200 (LeaseCandidate): OK
401: Unauthorized
list 列举或监视类别为 LeaseCandidate 的对象
HTTP 请求
GET /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates
参数
namespace (路径参数): string,必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
sendInitialEvents (查询参数): boolean
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
响应
200 (LeaseCandidateList): OK
401: Unauthorized
list 列举或监视类别为 LeaseCandidate 的对象
HTTP 请求
GET /apis/coordination.k8s.io/v1beta1/leasecandidates
参数
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
sendInitialEvents (查询参数): boolean
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
响应
200 (LeaseCandidateList): OK
401: Unauthorized
create 创建 LeaseCandidate
HTTP 请求
POST /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates
参数
namespace (路径参数): string,必需
body: LeaseCandidate,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
响应
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,必需
body: LeaseCandidate,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
响应
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,必需
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
响应
200 (LeaseCandidate): OK
201 (LeaseCandidate): Created
401: Unauthorized
delete 删除 LeaseCandidate
HTTP 请求
DELETE /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}
参数
name (路径参数): string,必需
LeaseCandidate 的名称。
namespace (路径参数): string,必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
ignoreStoreReadErrorWithClusterBreakingPotential (查询参数): boolean
pretty (查询参数): string
propagationPolicy (查询参数): string
响应
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection 删除 LeaseCandidate 的集合
HTTP 请求
DELETE /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates
参数
namespace (路径参数): string,必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
ignoreStoreReadErrorWithClusterBreakingPotential (查询参数): boolean
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
sendInitialEvents (查询参数): boolean
timeoutSeconds (查询参数): integer
响应
200 (Status): OK
401: Unauthorized