Skip to content

Commit 1762dc4

Browse files
authored
Merge pull request #48075 from windsonsea/leasey
[zh] Sync cluster-resources/lease-v1.md
2 parents 3e5e73e + cf42520 commit 1762dc4

File tree

1 file changed

+67
-43
lines changed
  • content/zh-cn/docs/reference/kubernetes-api/cluster-resources

1 file changed

+67
-43
lines changed

content/zh-cn/docs/reference/kubernetes-api/cluster-resources/lease-v1.md

Lines changed: 67 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,22 @@ Lease 定义了租约的概念。
3737

3838
- **kind**: Lease
3939

40+
<!--
4041
- **metadata** (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta</a>)
4142
42-
<!--
4343
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
44-
-->
45-
更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
4644
4745
- **spec** (<a href="{{< ref "../cluster-resources/lease-v1#LeaseSpec" >}}">LeaseSpec</a>)
4846
49-
<!--
5047
spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
51-
-->
48+
-->
49+
- **metadata** (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta</a>)
50+
51+
更多信息:
52+
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
53+
54+
- **spec** (<a href="{{< ref "../cluster-resources/lease-v1#LeaseSpec" >}}">LeaseSpec</a>)
55+
5256
spec 包含 Lease 的规约。更多信息:
5357
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
5458

@@ -57,7 +61,7 @@ Lease 定义了租约的概念。
5761
<!--
5862
LeaseSpec is a specification of a Lease.
5963
-->
60-
LeaseSpec 是一个 Lease 的规约。
64+
LeaseSpec Lease 的规约。
6165

6266
<hr>
6367

@@ -71,7 +75,7 @@ LeaseSpec 是一个 Lease 的规约。
7175
7276
- **holderIdentity** (string)
7377
74-
holderIdentity contains the identity of the holder of a current lease.
78+
holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field.
7579
-->
7680
- **acquireTime** (MicroTime)
7781

@@ -83,38 +87,61 @@ LeaseSpec 是一个 Lease 的规约。
8387
- **holderIdentity** (string)
8488

8589
holderIdentity 包含当前租约持有人的身份。
90+
如果使用协调领导者选举(Coordinated Leader Election),
91+
则持有人身份必须等于选举出的 LeaseCandidate.metadata.name 字段。
8692

8793
<!--
8894
- **leaseDurationSeconds** (int32)
8995
90-
leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed renewTime.
96+
leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measured against the time of last observed renewTime.
9197
9298
- **leaseTransitions** (int32)
9399
94100
leaseTransitions is the number of transitions of a lease between holders.
95101
96-
- **renewTime** (MicroTime)
102+
- **preferredHolder** (string)
97103
98-
renewTime is a time when the current holder of a lease has last updated the lease.
99-
100-
<a name="MicroTime"></a>
101-
*MicroTime is version of Time with microsecond level precision.*
104+
PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set.
102105
-->
103106
- **leaseDurationSeconds** (int32)
104107

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

107111
- **leaseTransitions** (int32)
108112

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

115+
- **preferredHolder** (string)
116+
117+
preferredHolder 向租约持有人发出信号,提示此租约出现一个更优的持有人且应该被放弃。
118+
此字段仅在设置了 `strategy` 时才能被设置。
119+
120+
<!--
121+
- **renewTime** (MicroTime)
122+
123+
renewTime is a time when the current holder of a lease has last updated the lease.
124+
125+
<a name="MicroTime"></a>
126+
*MicroTime is version of Time with microsecond level precision.*
127+
128+
- **strategy** (string)
129+
130+
Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
131+
-->
111132
- **renewTime** (MicroTime)
112133

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

115136
<a name="MicroTime"></a>
116137
**MicroTime 是具有微秒级精度的时间版本。**
117138

139+
- **strategy**(字符串)
140+
141+
strategy 指示为协调领导者选举选择领导者的策略。
142+
如果此字段未被指定,则此租约没有主动的协调。
143+
(Alpha)使用此字段需要启用 CoordinatedLeaderElection 特性门控。
144+
118145
## LeaseList {#LeaseList}
119146

120147
<!--
@@ -136,11 +163,13 @@ LeaseList 是 Lease 对象的列表。
136163
标准的列表元数据。更多信息:
137164
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
138165

166+
<!--
139167
- **items** ([]<a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease</a>), required
140168
141-
<!--
142169
items is a list of schema objects.
143-
-->
170+
-->
171+
- **items** ([]<a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease</a>),必需
172+
144173
items 是架构对象的列表。
145174

146175
<!--
@@ -154,20 +183,16 @@ LeaseList 是 Lease 对象的列表。
154183
### `get` read the specified Lease
155184
156185
#### HTTP Request
157-
158-
GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
159-
160-
#### Parameters
161186
-->
162187
### `get` 读取指定的 Lease
163188

164189
#### HTTP 请求
165190

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

168-
#### 参数
169-
170193
<!--
194+
#### Parameters
195+
171196
- **name** (*in path*): string, required
172197
173198
name of the Lease
@@ -180,11 +205,13 @@ GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
180205
181206
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
182207
-->
183-
- **name** (**路径参数**): string, 必需
208+
#### 参数
209+
210+
- **name** (**路径参数**): string,必需
184211

185-
Lease 名称
212+
Lease 的名称
186213

187-
- **namespace** (**路径参数**): string, 必需
214+
- **namespace** (**路径参数**): string必需
188215

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

@@ -205,10 +232,8 @@ GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
205232
### `list` list or watch objects of kind Lease
206233
207234
#### HTTP Request
208-
209-
GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
210235
-->
211-
### `list` 列出或监视 Lease 类对象
236+
### `list` 列出或监视类别为 Lease 的对象
212237

213238
#### HTTP 请求
214239

@@ -267,7 +292,7 @@ GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
267292
-->
268293
#### 参数
269294

270-
- **namespace** (**路径参数**): string, 必需
295+
- **namespace** (**路径参数**): string必需
271296

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

@@ -329,7 +354,7 @@ GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
329354
330355
#### HTTP Request
331356
-->
332-
### `list` 列出或监视 Lease 类对象
357+
### `list` 列出或监视类别为 Lease 的对象
333358

334359
#### HTTP 请求
335360

@@ -381,7 +406,6 @@ GET /apis/coordination.k8s.io/v1/leases
381406
- **watch** (*in query*): boolean
382407
383408
<a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch</a>
384-
385409
-->
386410
#### 参数
387411

@@ -476,11 +500,11 @@ POST /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
476500
-->
477501
#### 参数
478502

479-
- **namespace** (**路径参数**): string, 必需
503+
- **namespace** (**路径参数**): string必需
480504

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

483-
- **body**: <a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease</a>, 必需
507+
- **body**: <a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease</a>必需
484508

485509
- **dryRun** (**查询参数**): string
486510

@@ -553,15 +577,15 @@ PUT /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
553577
-->
554578
#### 参数
555579

556-
- **name** (**路径参数**): string, 必需
580+
- **name** (**路径参数**): string必需
557581

558582
Lease 的名称。
559583

560-
- **namespace** (**路径参数**): string, 必需
584+
- **namespace** (**路径参数**): string必需
561585

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

564-
- **body**: <a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease</a>, 必需
588+
- **body**: <a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease</a>必需
565589

566590
- **dryRun** (**查询参数**): string
567591

@@ -636,15 +660,15 @@ PATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
636660
-->
637661
#### 参数
638662

639-
- **name** (**路径参数**): string, 必需
663+
- **name** (**路径参数**): string必需
640664

641665
Lease 的名称。
642666

643-
- **namespace** (**路径参数**): string, 必需
667+
- **namespace** (**路径参数**): string必需
644668

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

647-
- **body**: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch</a>, 必需
671+
- **body**: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch</a>必需
648672

649673
- **dryRun** (**查询参数**): string
650674

@@ -682,7 +706,7 @@ PATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
682706
683707
#### HTTP Request
684708
-->
685-
### `delete` 删除一个 Lease
709+
### `delete` 删除 Lease
686710

687711
#### HTTP 请求
688712

@@ -719,11 +743,11 @@ DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
719743
-->
720744
#### 参数
721745

722-
- **name** (**路径参数**): string, 必需
746+
- **name** (**路径参数**): string必需
723747

724748
Lease 的名称。
725749

726-
- **namespace** (**路径参数**): string, 必需
750+
- **namespace** (**路径参数**): string必需
727751

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

@@ -826,7 +850,7 @@ DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
826850
-->
827851
#### 参数
828852

829-
- **namespace** (**路径参数**): string, 必需
853+
- **namespace** (**路径参数**): string必需
830854

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

0 commit comments

Comments
 (0)