Skip to content

Commit ca69e28

Browse files
committed
[zh-cn]sync stateful-set-v1
Signed-off-by: xin.li <[email protected]>
1 parent fbfc5b5 commit ca69e28

1 file changed

Lines changed: 56 additions & 44 deletions

File tree

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

Lines changed: 56 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ api_metadata:
66
content_type: "api_reference"
77
description: "StatefulSet 表示一组具有一致身份的 Pod"
88
title: "StatefulSet"
9-
weight: 7
9+
weight: 8
1010
auto_generated: true
1111
---
1212

@@ -18,7 +18,7 @@ api_metadata:
1818
content_type: "api_reference"
1919
description: "StatefulSet represents a set of pods with consistent identities."
2020
title: "StatefulSet"
21-
weight: 7
21+
weight: 8
2222
auto_generated: true
2323
-->
2424

@@ -53,7 +53,7 @@ StatefulSet 保证给定的网络身份将始终映射到相同的存储身份
5353
<!--
5454
Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
5555
-->
56-
56+
5757
标准的对象元数据。更多信息:
5858
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata。
5959

@@ -70,19 +70,19 @@ StatefulSet 保证给定的网络身份将始终映射到相同的存储身份
7070
<!--
7171
Status is the current status of Pods in this StatefulSet. This data may be out of date by some window of time.
7272
-->
73-
73+
7474
`status` 是 StatefulSet 中 Pod 的当前状态,此数据可能会在某个时间窗口内过时。
7575

7676
## StatefulSetSpec {#StatefulSetSpec}
7777

7878
<!--
79-
A StatefulSetSpec is the specification of a StatefulSet.
79+
A StatefulSetSpec is the specification of a StatefulSet.
8080
-->
8181
StatefulSetSpec 是 StatefulSet 的规约。
8282

8383
<hr>
8484

85-
<!--
85+
<!--
8686
- **serviceName** (string)
8787
8888
serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where "pod-specific-string" is managed by the StatefulSet controller.
@@ -105,7 +105,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
105105
此选择算符必须与 Pod 模板中的 label 匹配。更多信息:
106106
https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/labels/#label-selectors
107107

108-
<!--
108+
<!--
109109
- **template** (<a href="{{< ref "../workload-resources/pod-template-v1#PodTemplateSpec" >}}">PodTemplateSpec</a>), required
110110
111111
template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. Each pod will be named with the format \<statefulsetname>-\<podindex>. For example, a pod in a StatefulSet named "web" with index number "3" would be named "web-3". The only allowed template.spec.restartPolicy value is "Always".
@@ -118,7 +118,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
118118
例如,名为 "web" 且索引号为 "3" 的 StatefulSet 中的 Pod 将被命名为 "web-3"。
119119
`template.spec.restartPolicy` 唯一被允许的值是 `Always`
120120

121-
<!--
121+
<!--
122122
- **replicas** (int32)
123123
124124
replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity.
@@ -129,7 +129,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
129129
`replicas` 是给定模板的所需的副本数。之所以称作副本,是因为它们是相同模板的实例,
130130
不过各个副本也具有一致的身份。如果未指定,则默认为 1。
131131

132-
<!--
132+
<!--
133133
- **updateStrategy** (StatefulSetUpdateStrategy)
134134
135135
updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.
@@ -139,7 +139,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
139139
`updateStrategy` 是一个 StatefulSetUpdateStrategy,表示当对
140140
`template` 进行修订时,用何种策略更新 StatefulSet 中的 Pod 集合。
141141

142-
<!--
142+
<!--
143143
<a name="StatefulSetUpdateStrategy"></a>
144144
*StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.*
145145
-->
@@ -156,25 +156,10 @@ StatefulSetSpec 是 StatefulSet 的规约。
156156

157157
`type` 表示 StatefulSetUpdateStrategy 的类型,默认为 `RollingUpdate`
158158

159-
<!--
160-
Possible enum values:
161-
- `"OnDelete"` triggers the legacy behavior. Version tracking and ordered rolling restarts are disabled. Pods are recreated from the StatefulSetSpec when they are manually deleted. When a scale operation is performed with this strategy,specification version indicated by the StatefulSet's currentRevision.
162-
- `"RollingUpdate"` indicates that update will be applied to all Pods in the StatefulSet with respect to the StatefulSet ordering constraints. When a scale operation is performed with this strategy, new Pods will be created from the specification version indicated by the StatefulSet's updateRevision.
163-
-->
164-
165-
可能的枚举值:
166-
167-
- `"OnDelete"` 触发传统行为。版本跟踪和有序滚动重启被禁用。
168-
当 Pod 被手动删除时,它们会根据 `StatefulSetSpec` 重新创建。
169-
使用此策略执行扩缩操作时,将依据 StatefulSet 的 `currentRevision` 指示的版本。
170-
- `"RollingUpdate"` 表示更新将应用于 StatefulSet 中的所有 Pod,
171-
并遵循 StatefulSet 的排序约束。使用此策略执行扩缩操作时,新 Pod
172-
将根据 StatefulSet 的 `updateRevision` 指示的版本创建。
173-
174159
- **updateStrategy.rollingUpdate** (RollingUpdateStatefulSetStrategy)
175160

176-
<!--
177-
RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType.
161+
<!--
162+
RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType.
178163
-->
179164

180165
`type` 为 RollingUpdate 时,使用 `rollingUpdate` 来传递参数。
@@ -189,7 +174,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
189174

190175
- **updateStrategy.rollingUpdate.maxUnavailable** (IntOrString)
191176

192-
<!--
177+
<!--
193178
The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. This can not be 0. Defaults to 1. This field is beta-level and is enabled by default. The field applies to all pods in the range 0 to Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it will be counted towards MaxUnavailable. This setting might not be effective for the OrderedReady podManagementPolicy. That policy ensures pods are created and become ready one at a time.
194179
-->
195180

@@ -200,7 +185,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
200185
这些 Pod 将被计入 `maxUnavailable` 中。此设置可能对 OrderedReady Pod 管理策略无效。
201186
此策略确保 Pod 按顺序创建并就绪。
202187

203-
<!--
188+
<!--
204189
<a name="IntOrString"></a>
205190
*IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.*
206191
-->
@@ -211,7 +196,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
211196

212197
- **updateStrategy.rollingUpdate.partition** (int32)
213198

214-
<!--
199+
<!--
215200
Partition indicates the ordinal at which the StatefulSet should be partitioned for updates. During a rolling update, all pods from ordinal Replicas-1 to Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched. This is helpful in being able to do a canary based deployment. The default value is 0.
216201
-->
217202

@@ -222,7 +207,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
222207

223208
- **podManagementPolicy** (string)
224209

225-
<!--
210+
<!--
226211
podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once.
227212
-->
228213

@@ -233,7 +218,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
233218

234219
- **revisionHistoryLimit** (int32)
235220

236-
<!--
221+
<!--
237222
revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.
238223
239224
*Atomic: will be replaced during a merge*
@@ -246,7 +231,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
246231

247232
**原子:将在合并期间被替换**
248233

249-
<!--
234+
<!--
250235
volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name.
251236
-->
252237

@@ -257,7 +242,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
257242

258243
- **minReadySeconds** (int32)
259244

260-
<!--
245+
<!--
261246
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)
262247
-->
263248

@@ -275,7 +260,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
275260
此策略允许更改申领的生命周期,例如在 StatefulSet 被删除或其中 Pod 集合被缩容时删除持久卷申领。
276261
此属性需要启用 StatefulSetAutoDeletePVC 特性门控。特性处于 Beta 阶段。
277262

278-
<!--
263+
<!--
279264
<a name="StatefulSetPersistentVolumeClaimRetentionPolicy"></a>
280265
*StatefulSetPersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from the StatefulSet VolumeClaimTemplates.*
281266
-->
@@ -285,7 +270,7 @@ StatefulSetSpec 是 StatefulSet 的规约。
285270

286271
- **persistentVolumeClaimRetentionPolicy.whenDeleted** (string)
287272

288-
<!--
273+
<!--
289274
WhenDeleted specifies what happens to PVCs created from StatefulSet VolumeClaimTemplates when the StatefulSet is deleted. The default policy of `Retain` causes PVCs to not be affected by StatefulSet deletion. The `Delete` policy causes those PVCs to be deleted.
290275
-->
291276

@@ -325,22 +310,22 @@ StatefulSetSpec 是 StatefulSet 的规约。
325310
If unset, defaults to 0. Replica indices will be in the range:
326311
[0, .spec.replicas).
327312
-->
328-
313+
329314
`start` 是代表第一个副本索引的数字。它可用于从替代索引(例如:从 1 开始索引)而非默认的从 0 索引来为副本设置编号,
330315
还可用于编排从一个 StatefulSet 到另一个 StatefulSet 的渐进式副本迁移动作。如果设置了此值,副本索引范围为
331316
[.spec.ordinals.start, .spec.ordinals.start + .spec.replicas)。如果不设置,则默认为 0。
332317
副本索引范围为 [0, .spec.replicas)。
333318

334319
## StatefulSetStatus {#StatefulSetStatus}
335320

336-
<!--
321+
<!--
337322
StatefulSetStatus represents the current state of a StatefulSet.
338323
-->
339324
StatefulSetStatus 表示 StatefulSet 的当前状态。
340325

341326
<hr>
342327

343-
<!--
328+
<!--
344329
- **replicas** (int32), required
345330
346331
replicas is the number of Pods created by the StatefulSet controller.
@@ -351,37 +336,37 @@ StatefulSetStatus 表示 StatefulSet 的当前状态。
351336

352337
- **readyReplicas** (int32)
353338

354-
<!--
339+
<!--
355340
readyReplicas is the number of pods created for this StatefulSet with a Ready Condition.
356341
-->
357342
`readyReplicas` 是为此 StatefulSet 创建的、状况为 Ready 的 Pod 个数。
358343

359344
- **currentReplicas** (int32)
360345

361-
<!--
346+
<!--
362347
currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision.
363348
-->
364349
`currentReplicas` 是 StatefulSet 控制器根据 `currentReplicas` 所指的
365350
StatefulSet 版本创建的 Pod 个数。
366351

367352
- **updatedReplicas** (int32)
368353

369-
<!--
354+
<!--
370355
updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision.
371356
-->
372357
`updatedReplicas` 是 StatefulSet 控制器根据 `updateRevision` 所指的
373358
StatefulSet 版本创建的 Pod 个数。
374359

375360
- **availableReplicas** (int32)
376361

377-
<!--
362+
<!--
378363
Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset.
379364
-->
380365
此 StatefulSet 所对应的可用 Pod 总数(就绪时长至少为 `minReadySeconds`)。
381366

382367
- **collisionCount** (int32)
383368

384-
<!--
369+
<!--
385370
collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision.
386371
-->
387372
`collisionCount` 是 StatefulSet 的哈希冲突计数。
@@ -738,6 +723,15 @@ GET /apis/apps/v1/namespaces/{namespace}/statefulsets
738723

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

726+
<!--
727+
- **shardSelector** (*in query*): string
728+
729+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
730+
-->
731+
- **shardSelector** (**查询参数**): string
732+
733+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
734+
741735
<!--
742736
- **timeoutSeconds** (*in query*): integer
743737
@@ -861,6 +855,15 @@ GET /apis/apps/v1/statefulsets
861855

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

858+
<!--
859+
- **shardSelector** (*in query*): string
860+
861+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
862+
-->
863+
- **shardSelector** (**查询参数**): string
864+
865+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
866+
864867
<!--
865868
- **timeoutSeconds** (*in query*): integer
866869
@@ -1549,6 +1552,15 @@ DELETE /apis/apps/v1/namespaces/{namespace}/statefulsets
15491552

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

1555+
<!--
1556+
- **shardSelector** (*in query*): string
1557+
1558+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
1559+
-->
1560+
- **shardSelector** (**查询参数**): string
1561+
1562+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
1563+
15521564
<!--
15531565
- **timeoutSeconds** (*in query*): integer
15541566

0 commit comments

Comments
 (0)