From 93b687676c268a3bbbbdd6188133bf866e63031b Mon Sep 17 00:00:00 2001 From: huangminjie Date: Sat, 7 May 2022 23:10:46 +0800 Subject: [PATCH] [zh] sync v1.24 concepts/workloads/controllers/statefulset.md --- .../workloads/controllers/statefulset.md | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/content/zh/docs/concepts/workloads/controllers/statefulset.md b/content/zh/docs/concepts/workloads/controllers/statefulset.md index a7919d8207..22a3cdcca7 100644 --- a/content/zh/docs/concepts/workloads/controllers/statefulset.md +++ b/content/zh/docs/concepts/workloads/controllers/statefulset.md @@ -477,7 +477,9 @@ in the same order as Pod termination (from the largest ordinal to the smallest), each Pod one at a time. The Kubernetes control plane waits until an updated Pod is Running and Ready prior -to updating its predecessor. If you have set `.spec.minReadySeconds` (see [Minimum Ready Seconds](#minimum-ready-seconds)), the control plane additionally waits that amount of time after the Pod turns ready, before moving on. +to updating its predecessor. If you have set `.spec.minReadySeconds` (see +[Minimum Ready Seconds](#minimum-ready-seconds)), the control plane additionally waits that +amount of time after the Pod turns ready, before moving on. --> ## 滚动更新 {#rolling-updates} @@ -513,6 +515,47 @@ update, roll out a canary, or perform a phased roll out. 在大多数情况下,你不需要使用分区,但如果你希望进行阶段更新、执行金丝雀或执行 分阶段上线,则这些分区会非常有用。 + +### 最大不可用 Pod + +{{< feature-state for_k8s_version="v1.24" state="alpha" >}} + + +你可以通过指定 `.spec.updateStrategy.rollingUpdate.maxUnavailable` +字段来控制更新期间不可用的 Pod 的最大数量。 +该值可以是绝对值(例如,“5”)或者是期望 Pod 个数的百分比(例如,`10%`)。 +绝对值是根据百分比值四舍五入计算的。 +该字段不能为 0。默认设置为 1。 + + +该字段适用于 `0` 到 `replicas - 1` 范围内的所有 Pod。 +如果在 `0` 到 `replicas - 1` 范围内存在不可用 Pod,这类 Pod 将被计入 `maxUnavailable` 值。 + + +{{< note >}} +`maxUnavailable` 字段处于 Alpha 阶段,仅当 API 服务器启用了 `MaxUnavailableStatefulSet` +[特性门控](/zh/docs/reference/commmand-line-tools-reference/feature-gates/)时才起作用。 +{{< /note >}} +