@@ -14,6 +14,8 @@ slug: maxunavailable-for-statefulset
14
14
-->
15
15
** 作者:** Mayank Kumar (Salesforce)
16
16
17
+ ** 译者:** Xiaoyang Zhang(Huawei)
18
+
17
19
<!--
18
20
Kubernetes [StatefulSets](/docs/concepts/workloads/controllers/statefulset/), since their introduction in
19
21
1.5 and becoming stable in 1.9, have been widely used to run stateful applications. They provide stable pod identity, persistent
@@ -33,7 +35,7 @@ Kubernetes [StatefulSet](/zh-cn/docs/concepts/workloads/controllers/statefulset/
33
35
Here are some examples:
34
36
35
37
- I am using a StatefulSet to orchestrate a multi-instance, cache based application where the size of the cache is large. The cache
36
- starts cold and requires some siginificant amount of time before the container can start. There could be more initial startup tasks
38
+ starts cold and requires some significant amount of time before the container can start. There could be more initial startup tasks
37
39
that are required. A RollingUpdate on this StatefulSet would take a lot of time before the application is fully updated. If the
38
40
StatefulSet supported updating more than one pod at a time, it would result in a much faster update.
39
41
-->
82
84
app: nginx
83
85
spec:
84
86
containers:
85
- - image: k8s.gcr.io/nginx-slim:0.8
87
+ # 镜像自发布以来已更改(以前使用的仓库为 "k8s.gcr.io")
88
+ - image: registry.k8s.io/nginx-slim:0.8
86
89
imagePullPolicy: IfNotPresent
87
90
name: nginx
88
91
updateStrategy:
@@ -107,15 +110,15 @@ has 5 replicas, with `maxUnavailable` set to 2 and `partition` set to 0.
107
110
` maxUnavailable ` 设置为 2 并将 ` partition ` 设置为 0。
108
111
109
112
<!--
110
- I can trigger a rolling update by changing the image to `k8s.gcr .io/nginx-slim:0.9`. Once I initiate the rolling update, I can
113
+ I can trigger a rolling update by changing the image to `registry.k8s .io/nginx-slim:0.9`. Once I initiate the rolling update, I can
111
114
watch the pods update 2 at a time as the current value of maxUnavailable is 2. The below output shows a span of time and is not
112
115
complete. The maxUnavailable can be an absolute number (for example, 2) or a percentage of desired Pods (for example, 10%). The
113
- absolute number is calculated from percentage by rounding down.
116
+ absolute number is calculated from percentage by rounding up to the nearest integer.
114
117
-->
115
- 我可以通过将镜像更改为 ` k8s.gcr .io/nginx-slim:0.9` 来触发滚动更新。一旦开始滚动更新,
118
+ 我可以通过将镜像更改为 ` registry.k8s .io/nginx-slim:0.9` 来触发滚动更新。一旦开始滚动更新,
116
119
就可以看到一次更新 2 个 Pod,因为 ` maxUnavailable ` 的当前值是 2。
117
120
下面的输出显示了一个时间段内的结果,但并不是完整过程。` maxUnavailable ` 可以是绝对数值(例如 2)或所需 Pod
118
- 的百分比(例如 10%),绝对数是通过百分比计算结果进行四舍五入得出的 。
121
+ 的百分比(例如 10%),绝对数是通过百分比计算结果进行四舍五入到最接近的整数得出的 。
119
122
120
123
```
121
124
kubectl get pods --watch
0 commit comments