Skip to content

Commit e92477b

Browse files
authored
Merge pull request #34014 from Sea-n/zh-code-output-manage
[zh] Sync manage-daemon
2 parents b608cc1 + dd34014 commit e92477b

File tree

2 files changed

+69
-59
lines changed

2 files changed

+69
-59
lines changed

content/zh/docs/tasks/manage-daemon/update-daemon-set.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ content_type: task
1212
-->
1313

1414
<!-- overview -->
15+
1516
<!--
1617
This page shows how to perform a rolling update on a DaemonSet.
1718
-->
@@ -28,7 +29,7 @@ This page shows how to perform a rolling update on a DaemonSet.
2829
2930
DaemonSet has two update strategy types:
3031
-->
31-
## DaemonSet 更新策略
32+
## DaemonSet 更新策略 {#daemonset-update-strategy}
3233

3334
DaemonSet 有两种更新策略:
3435

@@ -40,8 +41,8 @@ DaemonSet 有两种更新策略:
4041
* `RollingUpdate`: This is the default update strategy.
4142
With `RollingUpdate` update strategy, after you update a
4243
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.
4546
-->
4647

4748
* `OnDelete`: 使用 `OnDelete` 更新策略时,在更新 DaemonSet 模板后,只有当你手动删除老的
@@ -56,16 +57,16 @@ DaemonSet 有两种更新策略:
5657
To enable the rolling update feature of a DaemonSet, you must set its
5758
`.spec.updateStrategy.type` to `RollingUpdate`.
5859
-->
59-
## 执行滚动更新
60+
## 执行滚动更新 {#performing-a-rolling-update}
6061

6162
要启用 DaemonSet 的滚动更新功能,必须设置 `.spec.updateStrategy.type``RollingUpdate`
6263

6364
<!--
64-
You may want to set
65+
You may want to set
6566
[`.spec.updateStrategy.rollingUpdate.maxUnavailable`](/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec)
6667
(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
6970
[`.spec.updateStrategy.rollingUpdate.maxSurge`](/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec)
7071
(a beta feature and defaults to 0) as well.
7172
@@ -74,14 +75,14 @@ You may want to set
7475
[`.spec.updateStrategy.rollingUpdate.maxUnavailable`](/zh/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec) (默认为 1),
7576
[`.spec.minReadySeconds`](/zh/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec) (默认为 0) 和
7677
[`.spec.updateStrategy.rollingUpdate.maxSurge`](/zh/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec)
77-
(一种 Beta 阶段的特性,默认为 0)。
78+
(一种 Beta 阶段的特性,默认为 0)。
7879

7980
<!--
8081
### Creating a DaemonSet with `RollingUpdate` update strategy
8182
8283
This YAML file specifies a DaemonSet with an update strategy as 'RollingUpdate'
8384
-->
84-
### 创建带有 `RollingUpdate` 更新策略的 DaemonSet
85+
### 创建带有 `RollingUpdate` 更新策略的 DaemonSet {#creating-a-daemonset-with-rollingupdate-update-strategy}
8586

8687
下面的 YAML 包含一个 DaemonSet,其更新策略为 'RollingUpdate':
8788

@@ -113,7 +114,7 @@ kubectl apply -f https://k8s.io/examples/controllers/fluentd-daemonset.yaml
113114
Check the update strategy of your DaemonSet, and make sure it's set to
114115
`RollingUpdate`:
115116
-->
116-
### 检查 DaemonSet 的滚动更新策略
117+
### 检查 DaemonSet 的滚动更新策略 {#checking-daemonset-rollingupdate-update-strategy}
117118

118119
首先,检查 DaemonSet 的更新策略,确保已经将其设置为 `RollingUpdate`:
119120

@@ -152,7 +153,7 @@ manifest accordingly.
152153
Any updates to a `RollingUpdate` DaemonSet `.spec.template` will trigger a rolling
153154
update. Let's update the DaemonSet by applying a new YAML file. This can be done with several different `kubectl` commands.
154155
-->
155-
### 更新 DaemonSet 模板
156+
### 更新 DaemonSet 模板 {#updating-a-daemonset-template}
156157

157158
`RollingUpdate` DaemonSet 的 `.spec.template` 的任何更新都将触发滚动更新。
158159
这可以通过几个不同的 `kubectl` 命令来完成。
@@ -166,7 +167,7 @@ If you update DaemonSets using
166167
[configuration files](/docs/tasks/manage-kubernetes-objects/declarative-config/),
167168
use `kubectl apply`:
168169
-->
169-
#### 声明式命令
170+
#### 声明式命令 {#declarative-commands}
170171

171172
如果你使用
172173
[配置文件](/zh/docs/tasks/manage-kubernetes-objects/declarative-config/)
@@ -180,14 +181,14 @@ kubectl apply -f https://k8s.io/examples/controllers/fluentd-daemonset-update.ya
180181
#### Imperative commands
181182
182183
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/),
184185
use `kubectl edit`:
185186
-->
186-
#### 指令式命令
187+
#### 指令式命令 {#imperative-commands}
187188

188189
如果你使用
189190
[指令式命令](/zh/docs/tasks/manage-kubernetes-objects/imperative-command/)
190-
来更新 DaemonSets,请使用`kubectl edit`
191+
来更新 DaemonSets,请使用 `kubectl edit`
191192

192193
```shell
193194
kubectl edit ds/fluentd-elasticsearch -n kube-system
@@ -199,21 +200,21 @@ kubectl edit ds/fluentd-elasticsearch -n kube-system
199200
If you only need to update the container image in the DaemonSet template, i.e.
200201
`.spec.template.spec.containers[*].image`, use `kubectl set image`:
201202
--->
202-
##### 只更新容器镜像
203+
##### 只更新容器镜像 {#updating-only-the-container-image}
203204

204-
如果你只需要更新 DaemonSet 模板里的容器镜像,比如`.spec.template.spec.containers[*].image`,
205-
请使用 `kubectl set image`:
205+
如果你只需要更新 DaemonSet 模板里的容器镜像,比如 `.spec.template.spec.containers[*].image`
206+
请使用 `kubectl set image`
206207

207208
```shell
208209
kubectl set image ds/fluentd-elasticsearch fluentd-elasticsearch=quay.io/fluentd_elasticsearch/fluentd:v2.6.0 -n kube-system
209210
```
210211

211212
<!--
212-
### Step 4: Watching the rolling update status
213+
### Watching the rolling update status
213214
214215
Finally, watch the rollout status of the latest DaemonSet rolling update:
215216
-->
216-
### 监视滚动更新状态
217+
### 监视滚动更新状态 {#watching-the-rolling-update-status}
217218

218219
最后,观察 DaemonSet 最新滚动更新的进度:
219220

@@ -235,9 +236,9 @@ daemonset "fluentd-elasticsearch" successfully rolled out
235236
236237
### DaemonSet rolling update is stuck
237238
-->
238-
## 故障排查
239+
## 故障排查 {#troubleshooting}
239240

240-
### DaemonSet 滚动更新卡住
241+
### DaemonSet 滚动更新卡住 {#daemonset-rolling-update-is-stuck}
241242

242243
<!--
243244
Sometimes, a DaemonSet rolling update may be stuck. Here are some possible
@@ -248,7 +249,7 @@ causes:
248249
有时,DaemonSet 滚动更新可能卡住,以下是一些可能的原因:
249250

250251

251-
#### 一些节点可用资源耗尽
252+
#### 一些节点可用资源耗尽 {#some-nodes-run-out-of-resources}
252253

253254
<!--
254255
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
294295
crash looping, or the container image doesn't exist (often due to a typo),
295296
DaemonSet rollout won't progress.
296297
-->
297-
#### 不完整的滚动更新
298+
#### 不完整的滚动更新 {#broken-rollout}
298299

299300
如果最近的 DaemonSet 模板更新被破坏了,比如,容器处于崩溃循环状态或者容器镜像不存在
300301
(通常由于拼写错误),就会发生 DaemonSet 滚动更新中断。
@@ -312,7 +313,7 @@ If `.spec.minReadySeconds` is specified in the DaemonSet, clock skew between
312313
master and nodes will make DaemonSet unable to detect the right rollout
313314
progress.
314315
-->
315-
#### 时钟偏差
316+
#### 时钟偏差 {#clock-skew}
316317

317318
如果在 DaemonSet 中指定了 `.spec.minReadySeconds`,主控节点和工作节点之间的时钟偏差会使
318319
DaemonSet 无法检测到正确的滚动更新进度。
@@ -322,7 +323,7 @@ DaemonSet 无法检测到正确的滚动更新进度。
322323
323324
Delete DaemonSet from a namespace :
324325
-->
325-
## 清理
326+
## 清理 {#clean-up}
326327

327328
从名字空间中删除 DaemonSet:
328329

0 commit comments

Comments
 (0)