Skip to content

Commit 94a2cdb

Browse files
authored
Merge pull request #53248 from my-git9/npe-7081
[zh-cn]sync deployment-v1
2 parents a12f311 + 7a47683 commit 94a2cdb

File tree

1 file changed

+55
-46
lines changed

1 file changed

+55
-46
lines changed

content/zh-cn/docs/reference/kubernetes-api/workload-resources/deployment-v1.md

Lines changed: 55 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ Deployment 使得 Pod 和 ReplicaSet 能够进行声明式更新。
5151
Most recently observed status of the Deployment.
5252
-->
5353
- **metadata** (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta</a>)
54-
54+
5555
标准的对象元数据。更多信息:
5656
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
5757

5858
- **spec** (<a href="{{< ref "../workload-resources/deployment-v1#DeploymentSpec" >}}">DeploymentSpec</a>)
59-
59+
6060
Deployment 预期行为的规约。
6161

6262
- **status** (<a href="{{< ref "../workload-resources/deployment-v1#DeploymentStatus" >}}">DeploymentStatus</a>)
63-
63+
6464
最近观测到的 Deployment 状态。
6565

6666
## DeploymentSpec {#DeploymentSpec}
@@ -82,12 +82,12 @@ DeploymentSpec 定义 Deployment 预期行为的规约。
8282
Template describes the pods that will be created. The only allowed template.spec.restartPolicy value is "Always".
8383
-->
8484
- **selector** (<a href="{{< ref "../common-definitions/label-selector#LabelSelector" >}}">LabelSelector</a>),必需
85-
85+
8686
供 Pod 所用的标签选择算符。通过此字段选择现有 ReplicaSet 的 Pod 集合,
8787
被选中的 ReplicaSet 将受到这个 Deployment 的影响。此字段必须与 Pod 模板的标签匹配。
8888

8989
- **template** (<a href="{{< ref "../workload-resources/pod-template-v1#PodTemplateSpec" >}}">PodTemplateSpec</a>),必需
90-
90+
9191
template 描述将要创建的 Pod。`template.spec.restartPolicy`
9292
唯一被允许的值是 `Always`
9393

@@ -101,19 +101,19 @@ DeploymentSpec 定义 Deployment 预期行为的规约。
101101
Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)
102102
-->
103103
- **replicas** (int32)
104-
104+
105105
预期 Pod 的数量。这是一个指针,用于辨别显式零和未指定的值。默认为 1。
106106

107107
- **minReadySeconds** (int32)
108-
108+
109109
新建的 Pod 在没有任何容器崩溃的情况下就绪并被系统视为可用的最短秒数。
110110
默认为 0(Pod 就绪后即被视为可用)。
111111

112112
<!--
113113
- **strategy** (DeploymentStrategy)
114114
115115
*Patch strategy: retainKeys*
116-
116+
117117
The deployment strategy to use to replace existing pods with new ones.
118118
119119
<a name="DeploymentStrategy"></a>
@@ -132,26 +132,35 @@ DeploymentSpec 定义 Deployment 预期行为的规约。
132132
- **strategy.type** (string)
133133
134134
Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
135-
135+
136+
Possible enum values:
137+
- `"Recreate"` Kill all existing pods before creating new ones.
138+
- `"RollingUpdate"` Replace the old ReplicaSets by new one using rolling update i.e gradually scale down the old ReplicaSets and scale up the new one.
139+
-->
140+
- **strategy.type** (string)
141+
142+
部署的类型。取值可以是 “Recreate” 或 “RollingUpdate”。默认为 RollingUpdate。
143+
144+
可能的枚举值:
145+
- `"Recreate"`:在创建新实例之前杀死所有现有的 Pod。
146+
- `"RollingUpdate"`:使用滚动更新替换旧的 ReplicaSet,即逐渐缩小旧的 ReplicaSet 并扩大新的 ReplicaSet。
147+
148+
<!--
136149
- **strategy.rollingUpdate** (RollingUpdateDeployment)
137150
138151
Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate.
139152
140153
<a name="RollingUpdateDeployment"></a>
141154
*Spec to control the desired behavior of rolling update.*
142155
-->
143-
144-
- **strategy.type** (string)
145-
146-
部署的类型。取值可以是 “Recreate” 或 “RollingUpdate”。默认为 RollingUpdate。
147156

148157
- **strategy.rollingUpdate** (RollingUpdateDeployment)
149-
158+
150159
滚动更新这些配置参数。仅当 DeploymentStrategyType = RollingUpdate 时才出现。
151160

152161
<a name="RollingUpdateDeployment"></a>
153162
**控制滚动更新预期行为的规约。**
154-
163+
155164
<!--
156165
- **strategy.rollingUpdate.maxSurge** (IntOrString)
157166
@@ -162,19 +171,19 @@ DeploymentSpec 定义 Deployment 预期行为的规约。
162171
-->
163172

164173
- **strategy.rollingUpdate.maxSurge** (IntOrString)
165-
174+
166175
超出预期的 Pod 数量之后可以调度的最大 Pod 数量。该值可以是一个绝对数(例如:
167176
5)或一个预期 Pod 的百分比(例如:10%)。如果 MaxUnavailable 为 0,则此字段不能为 0。
168177
通过向上取整计算得出一个百分比绝对数。默认为 25%。例如:当此值设为 30% 时,
169178
如果滚动更新启动,则可以立即对 ReplicaSet 扩容,从而使得新旧 Pod 总数不超过预期 Pod 数量的 130%。
170179
一旦旧 Pod 被杀死,则可以再次对新的 ReplicaSet 扩容,
171180
确保更新期间任何时间运行的 Pod 总数最多为预期 Pod 数量的 130%。
172-
181+
173182
<a name="IntOrString"></a>
174183
**IntOrString 是可以保存 int32 或字符串的一个类型。
175184
当用于 JSON 或 YAML 编组和取消编组时,它会产生或消费内部类型。
176185
例如,这允许你拥有一个可以接受名称或数值的 JSON 字段。**
177-
186+
178187
<!--
179188
- **strategy.rollingUpdate.maxUnavailable** (IntOrString)
180189
@@ -185,14 +194,14 @@ DeploymentSpec 定义 Deployment 预期行为的规约。
185194
-->
186195

187196
- **strategy.rollingUpdate.maxUnavailable** (IntOrString)
188-
197+
189198
更新期间可能不可用的最大 Pod 数量。该值可以是一个绝对数(例如:
190199
5)或一个预期 Pod 的百分比(例如:10%)。通过向下取整计算得出一个百分比绝对数。
191200
如果 MaxSurge 为 0,则此字段不能为 0。默认为 25%。
192201
例如:当此字段设为 30%,则在滚动更新启动时 ReplicaSet 可以立即缩容为预期 Pod 数量的 70%。
193202
一旦新的 Pod 就绪,ReplicaSet 可以再次缩容,接下来对新的 ReplicaSet 扩容,
194203
确保更新期间任何时间可用的 Pod 总数至少是预期 Pod 数量的 70%。
195-
204+
196205
<a name="IntOrString"></a>
197206
**IntOrString 是可以保存 int32 或字符串的一个类型。
198207
当用于 JSON 或 YAML 编组和取消编组时,它会产生或消费内部类型。
@@ -216,13 +225,13 @@ DeploymentSpec 定义 Deployment 预期行为的规约。
216225
保留允许回滚的旧 ReplicaSet 的数量。这是一个指针,用于辨别显式零和未指定的值。默认为 10。
217226

218227
- **progressDeadlineSeconds** (int32)
219-
228+
220229
Deployment 在被视为失败之前取得进展的最大秒数。Deployment 控制器将继续处理失败的 Deployment,
221230
原因为 ProgressDeadlineExceeded 的状况将被显示在 Deployment 状态中。
222231
请注意,在 Deployment 暂停期间将不会估算进度。默认为 600s。
223232

224233
- **paused** (boolean)
225-
234+
226235
指示 Deployment 被暂停。
227236

228237
## DeploymentStatus {#DeploymentStatus}
@@ -248,11 +257,11 @@ DeploymentStatus 是最近观测到的 Deployment 状态。
248257
Total number of non-terminating pods targeted by this Deployment with a Ready Condition.
249258
-->
250259
- **replicas** (int32)
251-
260+
252261
此 Deployment 所针对的(其标签与选择算符匹配)未终止 Pod 的总数。
253262

254263
- **availableReplicas** (int32)
255-
264+
256265
此 Deployment 针对的可用(至少 minReadySeconds 才能就绪)非终止的 Pod 总数。
257266

258267
- **readyReplicas** (int32)
@@ -265,7 +274,7 @@ DeploymentStatus 是最近观测到的 Deployment 状态。
265274
Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.
266275
-->
267276
- **unavailableReplicas** (int32)
268-
277+
269278
此 Deployment 针对的不可用 Pod 总数。这是 Deployment 具有 100% 可用容量时仍然必需的 Pod 总数。
270279
它们可能是正在运行但还不可用的 Pod,也可能是尚未创建的 Pod。
271280

@@ -277,15 +286,15 @@ DeploymentStatus 是最近观测到的 Deployment 状态。
277286
- **terminatingReplicas** (int32)
278287
279288
Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.
280-
289+
281290
This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.
282291
283292
- **collisionCount** (int32)
284293
285294
Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.
286295
-->
287296
- **updatedReplicas** (int32)
288-
297+
289298
此 Deployment 所针对的未终止 Pod 的总数,这些 Pod 采用了预期的模板规约。
290299

291300
- **terminatingReplicas** (int32)
@@ -297,7 +306,7 @@ DeploymentStatus 是最近观测到的 Deployment 状态。
297306
这是一个 Alpha 字段。要使用该字段,需要启用 DeploymentReplicaSetTerminatingReplicas 特性门控。
298307

299308
- **collisionCount** (int32)
300-
309+
301310
供 Deployment 所用的哈希冲突计数。
302311
Deployment 控制器在需要为最新的 ReplicaSet 创建名称时将此字段用作冲突预防机制。
303312

@@ -314,16 +323,16 @@ DeploymentStatus 是最近观测到的 Deployment 状态。
314323
*DeploymentCondition describes the state of a deployment at a certain point.*
315324
-->
316325
- **conditions** ([]DeploymentCondition)
317-
326+
318327
**补丁策略:按照键 `type` 合并**
319328

320-
**Map:键 `type` 的唯一值将在合并期间保留**
329+
**Map:键 `type` 的唯一值将在合并期间保留**
321330

322331
表示 Deployment 当前状态的最新可用观测值。
323-
332+
324333
<a name="DeploymentCondition"></a>
325334
**DeploymentCondition 描述某个点的 Deployment 状态。**
326-
335+
327336
<!--
328337
- **conditions.status** (string), required
329338
@@ -339,9 +348,9 @@ DeploymentStatus 是最近观测到的 Deployment 状态。
339348
状况的状态,取值为 True、False 或 Unknown 之一。
340349

341350
- **conditions.type** (string),必需
342-
351+
343352
Deployment 状况的类型。
344-
353+
345354
<!--
346355
- **conditions.lastTransitionTime** (Time)
347356
@@ -352,13 +361,13 @@ DeploymentStatus 是最近观测到的 Deployment 状态。
352361
-->
353362

354363
- **conditions.lastTransitionTime** (Time)
355-
364+
356365
状况上次从一个状态转换为另一个状态的时间。
357-
366+
358367
<a name="Time"></a>
359368
**Time 是对 time.Time 的封装。Time 支持对 YAML 和 JSON 进行正确封包。
360369
为 time 包的许多函数方法提供了封装器。**
361-
370+
362371
<!--
363372
- **conditions.lastUpdateTime** (Time)
364373
@@ -375,7 +384,7 @@ DeploymentStatus 是最近观测到的 Deployment 状态。
375384
<a name="Time"></a>
376385
**Time 是对 time.Time 的封装。Time 支持对 YAML 和 JSON 进行正确封包。
377386
为 time 包的许多函数方法提供了封装器。**
378-
387+
379388
<!--
380389
- **conditions.message** (string)
381390
@@ -389,7 +398,7 @@ DeploymentStatus 是最近观测到的 Deployment 状态。
389398
- **conditions.message** (string)
390399

391400
这是一条人类可读的消息,指示有关上次转换的详细信息。
392-
401+
393402
- **conditions.reason** (string)
394403

395404
状况上次转换的原因。
@@ -400,7 +409,7 @@ DeploymentStatus 是最近观测到的 Deployment 状态。
400409
The generation observed by the deployment controller.
401410
-->
402411
- **observedGeneration** (int64)
403-
412+
404413
Deployment 控制器观测到的代数(Generation)。
405414

406415
## DeploymentList {#DeploymentList}
@@ -426,11 +435,11 @@ DeploymentList 是 Deployment 的列表。
426435
Items is the list of Deployments.
427436
-->
428437
- **metadata** (<a href="{{< ref "../common-definitions/list-meta#ListMeta" >}}">ListMeta</a>)
429-
438+
430439
标准的列表元数据。
431440

432441
- **items** ([]<a href="{{< ref "../workload-resources/deployment-v1#Deployment" >}}">Deployment</a>),必需
433-
442+
434443
items 是 Deployment 的列表。
435444

436445
<!--
@@ -547,19 +556,19 @@ GET /apis/apps/v1/namespaces/{namespace}/deployments
547556
#### 参数
548557

549558
- **namespace** (**路径参数**): string,必需
550-
559+
551560
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
552561

553562
- **allowWatchBookmarks** (**查询参数**): boolean
554-
563+
555564
<a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks</a>
556565

557566
- **continue** (**查询参数**): string
558-
567+
559568
<a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue</a>
560569

561570
- **fieldSelector** (**查询参数**): string
562-
571+
563572
<a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector</a>
564573

565574
- **labelSelector** (**查询参数**): string

0 commit comments

Comments
 (0)