@@ -12,6 +12,7 @@ content_type: task
12
12
-->
13
13
14
14
<!-- overview -->
15
+
15
16
<!--
16
17
This page shows how to perform a rolling update on a DaemonSet.
17
18
-->
@@ -28,7 +29,7 @@ This page shows how to perform a rolling update on a DaemonSet.
28
29
29
30
DaemonSet has two update strategy types:
30
31
-->
31
- ## DaemonSet 更新策略
32
+ ## DaemonSet 更新策略 {#daemonset-update-strategy}
32
33
33
34
DaemonSet 有两种更新策略:
34
35
@@ -40,8 +41,8 @@ DaemonSet 有两种更新策略:
40
41
* `RollingUpdate`: This is the default update strategy.
41
42
With `RollingUpdate` update strategy, after you update a
42
43
DaemonSet template, old DaemonSet pods will be killed, and new DaemonSet pods
43
- will be created automatically, in a controlled fashion.
44
- At most one pod of the DaemonSet will be running on each node during the whole update process.
44
+ will be created automatically, in a controlled fashion. At most one pod of
45
+ the DaemonSet will be running on each node during the whole update process.
45
46
-->
46
47
47
48
* ` OnDelete ` : 使用 ` OnDelete ` 更新策略时,在更新 DaemonSet 模板后,只有当你手动删除老的
@@ -56,16 +57,16 @@ DaemonSet 有两种更新策略:
56
57
To enable the rolling update feature of a DaemonSet, you must set its
57
58
`.spec.updateStrategy.type` to `RollingUpdate`.
58
59
-->
59
- ## 执行滚动更新
60
+ ## 执行滚动更新 {#performing-a-rolling-update}
60
61
61
62
要启用 DaemonSet 的滚动更新功能,必须设置 ` .spec.updateStrategy.type ` 为 ` RollingUpdate ` 。
62
63
63
64
<!--
64
- You may want to set
65
+ You may want to set
65
66
[`.spec.updateStrategy.rollingUpdate.maxUnavailable`](/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec)
66
67
(default to 1),
67
- [`.spec.minReadySeconds`](/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec)
68
- (default to 0) and
68
+ [`.spec.minReadySeconds`](/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec)
69
+ (default to 0) and
69
70
[`.spec.updateStrategy.rollingUpdate.maxSurge`](/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec)
70
71
(a beta feature and defaults to 0) as well.
71
72
@@ -74,14 +75,14 @@ You may want to set
74
75
[ ` .spec.updateStrategy.rollingUpdate.maxUnavailable ` ] ( /zh/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec ) (默认为 1),
75
76
[ ` .spec.minReadySeconds ` ] ( /zh/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec ) (默认为 0) 和
76
77
[ ` .spec.updateStrategy.rollingUpdate.maxSurge ` ] ( /zh/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec )
77
- (一种 Beta 阶段的特性,默认为 0)。
78
+ (一种 Beta 阶段的特性,默认为 0)。
78
79
79
80
<!--
80
81
### Creating a DaemonSet with `RollingUpdate` update strategy
81
82
82
83
This YAML file specifies a DaemonSet with an update strategy as 'RollingUpdate'
83
84
-->
84
- ### 创建带有 ` RollingUpdate ` 更新策略的 DaemonSet
85
+ ### 创建带有 ` RollingUpdate ` 更新策略的 DaemonSet {#creating-a-daemonset-with-rollingupdate-update-strategy}
85
86
86
87
下面的 YAML 包含一个 DaemonSet,其更新策略为 'RollingUpdate':
87
88
@@ -113,7 +114,7 @@ kubectl apply -f https://k8s.io/examples/controllers/fluentd-daemonset.yaml
113
114
Check the update strategy of your DaemonSet, and make sure it's set to
114
115
`RollingUpdate`:
115
116
-->
116
- ### 检查 DaemonSet 的滚动更新策略
117
+ ### 检查 DaemonSet 的滚动更新策略 {#checking-daemonset-rollingupdate-update-strategy}
117
118
118
119
首先,检查 DaemonSet 的更新策略,确保已经将其设置为 ` RollingUpdate ` :
119
120
@@ -152,7 +153,7 @@ manifest accordingly.
152
153
Any updates to a `RollingUpdate` DaemonSet `.spec.template` will trigger a rolling
153
154
update. Let's update the DaemonSet by applying a new YAML file. This can be done with several different `kubectl` commands.
154
155
-->
155
- ### 更新 DaemonSet 模板
156
+ ### 更新 DaemonSet 模板 {#updating-a-daemonset-template}
156
157
157
158
对 ` RollingUpdate ` DaemonSet 的 ` .spec.template ` 的任何更新都将触发滚动更新。
158
159
这可以通过几个不同的 ` kubectl ` 命令来完成。
@@ -166,7 +167,7 @@ If you update DaemonSets using
166
167
[configuration files](/docs/tasks/manage-kubernetes-objects/declarative-config/),
167
168
use `kubectl apply`:
168
169
-->
169
- #### 声明式命令
170
+ #### 声明式命令 {#declarative-commands}
170
171
171
172
如果你使用
172
173
[ 配置文件] ( /zh/docs/tasks/manage-kubernetes-objects/declarative-config/ )
@@ -180,14 +181,14 @@ kubectl apply -f https://k8s.io/examples/controllers/fluentd-daemonset-update.ya
180
181
#### Imperative commands
181
182
182
183
If you update DaemonSets using
183
- [imperative commands](/docs/concepts/overview/object-management-kubectl /imperative-command/),
184
+ [imperative commands](/docs/tasks/manage-kubernetes-objects /imperative-command/),
184
185
use `kubectl edit`:
185
186
-->
186
- #### 指令式命令
187
+ #### 指令式命令 {#imperative-commands}
187
188
188
189
如果你使用
189
190
[ 指令式命令] ( /zh/docs/tasks/manage-kubernetes-objects/imperative-command/ )
190
- 来更新 DaemonSets,请使用` kubectl edit ` :
191
+ 来更新 DaemonSets,请使用 ` kubectl edit ` :
191
192
192
193
``` shell
193
194
kubectl edit ds/fluentd-elasticsearch -n kube-system
@@ -199,21 +200,21 @@ kubectl edit ds/fluentd-elasticsearch -n kube-system
199
200
If you only need to update the container image in the DaemonSet template, i.e.
200
201
`.spec.template.spec.containers[*].image`, use `kubectl set image`:
201
202
--->
202
- ##### 只更新容器镜像
203
+ ##### 只更新容器镜像 {#updating-only-the-container-image}
203
204
204
- 如果你只需要更新 DaemonSet 模板里的容器镜像,比如, ` .spec.template.spec.containers[*].image ` ,
205
- 请使用 ` kubectl set image ` :
205
+ 如果你只需要更新 DaemonSet 模板里的容器镜像,比如 ` .spec.template.spec.containers[*].image ` ,
206
+ 请使用 ` kubectl set image ` :
206
207
207
208
``` shell
208
209
kubectl set image ds/fluentd-elasticsearch fluentd-elasticsearch=quay.io/fluentd_elasticsearch/fluentd:v2.6.0 -n kube-system
209
210
```
210
211
211
212
<!--
212
- ### Step 4: Watching the rolling update status
213
+ ### Watching the rolling update status
213
214
214
215
Finally, watch the rollout status of the latest DaemonSet rolling update:
215
216
-->
216
- ### 监视滚动更新状态
217
+ ### 监视滚动更新状态 {#watching-the-rolling-update-status}
217
218
218
219
最后,观察 DaemonSet 最新滚动更新的进度:
219
220
@@ -235,9 +236,9 @@ daemonset "fluentd-elasticsearch" successfully rolled out
235
236
236
237
### DaemonSet rolling update is stuck
237
238
-->
238
- ## 故障排查
239
+ ## 故障排查 {#troubleshooting}
239
240
240
- ### DaemonSet 滚动更新卡住
241
+ ### DaemonSet 滚动更新卡住 {#daemonset-rolling-update-is-stuck}
241
242
242
243
<!--
243
244
Sometimes, a DaemonSet rolling update may be stuck. Here are some possible
@@ -248,7 +249,7 @@ causes:
248
249
有时,DaemonSet 滚动更新可能卡住,以下是一些可能的原因:
249
250
250
251
251
- #### 一些节点可用资源耗尽
252
+ #### 一些节点可用资源耗尽 {#some-nodes-run-out-of-resources}
252
253
253
254
<!--
254
255
The rollout is stuck because new DaemonSet pods can't be scheduled on at least one
@@ -294,7 +295,7 @@ If the recent DaemonSet template update is broken, for example, the container is
294
295
crash looping, or the container image doesn't exist (often due to a typo),
295
296
DaemonSet rollout won't progress.
296
297
-->
297
- #### 不完整的滚动更新
298
+ #### 不完整的滚动更新 {#broken-rollout}
298
299
299
300
如果最近的 DaemonSet 模板更新被破坏了,比如,容器处于崩溃循环状态或者容器镜像不存在
300
301
(通常由于拼写错误),就会发生 DaemonSet 滚动更新中断。
@@ -312,7 +313,7 @@ If `.spec.minReadySeconds` is specified in the DaemonSet, clock skew between
312
313
master and nodes will make DaemonSet unable to detect the right rollout
313
314
progress.
314
315
-->
315
- #### 时钟偏差
316
+ #### 时钟偏差 {#clock-skew}
316
317
317
318
如果在 DaemonSet 中指定了 ` .spec.minReadySeconds ` ,主控节点和工作节点之间的时钟偏差会使
318
319
DaemonSet 无法检测到正确的滚动更新进度。
@@ -322,7 +323,7 @@ DaemonSet 无法检测到正确的滚动更新进度。
322
323
323
324
Delete DaemonSet from a namespace :
324
325
-->
325
- ## 清理
326
+ ## 清理 {#clean-up}
326
327
327
328
从名字空间中删除 DaemonSet:
328
329
0 commit comments