Skip to content

Commit 4f53f10

Browse files
authored
Merge pull request #51644 from windsonsea/updmon
[zh] Update DaemonSet examples and docs
2 parents 16b66a1 + 49e35a4 commit 4f53f10

File tree

5 files changed

+26
-27
lines changed

5 files changed

+26
-27
lines changed

content/zh-cn/docs/concepts/workloads/controllers/daemonset.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ content_type: concept
99
weight: 40
1010
hide_summary: true # 在章节索引中单独列出
1111
---
12-
1312
<!--
1413
reviewers:
1514
- enisoc
@@ -68,16 +67,16 @@ different flags and/or different memory and cpu requests for different hardware
6867
6968
### Create a DaemonSet
7069
-->
71-
## 编写 DaemonSet Spec {#writing-a-daemon-set-spec}
70+
## 编写 DaemonSet 规约 {#writing-a-daemonset-spec}
7271

73-
### 创建 DaemonSet {#create-a-daemon-set}
72+
### 创建 DaemonSet {#create-a-daemonset}
7473

7574
<!--
7675
You can describe a DaemonSet in a YAML file. For example, the `daemonset.yaml` file below
7776
describes a DaemonSet that runs the fluentd-elasticsearch Docker image:
7877
-->
7978
你可以在 YAML 文件中描述 DaemonSet。
80-
例如,下面的 daemonset.yaml 文件描述了一个运行 fluentd-elasticsearch Docker 镜像的 DaemonSet:
79+
例如,下面的 `daemonset.yaml` 文件描述了一个运行 fluentd-elasticsearch Docker 镜像的 DaemonSet:
8180

8281
{{% code_sample file="controllers/daemonset.yaml" %}}
8382

@@ -86,7 +85,7 @@ Create a DaemonSet based on the YAML file:
8685
-->
8786
基于 YAML 文件创建 DaemonSet:
8887

89-
```
88+
```shell
9089
kubectl apply -f https://k8s.io/examples/controllers/daemonset.yaml
9190
```
9291

@@ -114,7 +113,8 @@ section.
114113
DaemonSet 对象的名称必须是一个合法的
115114
[DNS 子域名](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)
116115

117-
DaemonSet 也需要 [`.spec` 部分](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status)
116+
DaemonSet 也需要
117+
[`.spec` 部分](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status)
118118

119119
<!--
120120
### Pod Template
@@ -137,7 +137,7 @@ A Pod Template in a DaemonSet must have a [`RestartPolicy`](/docs/concepts/workl
137137

138138
`.spec.template` 是一个 [Pod 模板](/zh-cn/docs/concepts/workloads/pods/#pod-templates)
139139
除了它是嵌套的,因而不具有 `apiVersion``kind` 字段之外,它与
140-
{{< glossary_tooltip text="Pod" term_id="pod" >}} 具有相同的 schema
140+
{{< glossary_tooltip text="Pod" term_id="pod" >}} 具有相同的模式
141141

142142
除了 Pod 必需字段外,在 DaemonSet 中的 Pod 模板必须指定合理的标签(查看 [Pod 选择算符](#pod-selector))。
143143

@@ -179,7 +179,7 @@ The `.spec.selector` is an object consisting of two fields:
179179
-->
180180
* `matchLabels` - 与 [ReplicationController](/zh-cn/docs/concepts/workloads/controllers/replicationcontroller/)
181181
`.spec.selector` 的作用相同。
182-
* `matchExpressions` - 允许构建更加复杂的选择器,可以通过指定 key、value
182+
* `matchExpressions` - 允许构建更加复杂的选择算符,可以通过指定 key、value
183183
列表以及将 key 和 value 列表关联起来的 Operator。
184184

185185
<!--
@@ -215,7 +215,7 @@ If you do not specify either, then the DaemonSet controller will create Pods on
215215
<!--
216216
## How Daemon Pods are scheduled
217217
-->
218-
## Daemon Pods 是如何被调度的 {#how-daemon-pods-are-scheduled}
218+
## Daemon Pod 是如何被调度的 {#how-daemon-pods-are-scheduled}
219219

220220
<!--
221221
A DaemonSet can be used to ensure that all eligible nodes run a copy of a Pod.
@@ -299,7 +299,7 @@ nodeAffinity:
299299
The DaemonSet controller automatically adds a set of {{< glossary_tooltip
300300
text="tolerations" term_id="toleration" >}} to DaemonSet Pods:
301301
-->
302-
### 污点和容忍度 {#taint-and-toleration}
302+
### 污点和容忍度 {#taints-and-tolerations}
303303
304304
DaemonSet 控制器会自动将一组容忍度添加到 DaemonSet Pod:
305305
@@ -401,7 +401,7 @@ You can modify the Pods that a DaemonSet creates. However, Pods do not allow al
401401
fields to be updated. Also, the DaemonSet controller will use the original template the next
402402
time a node (even with the same name) is created.
403403
-->
404-
## 更新 DaemonSet {#updating-a-daemon-set}
404+
## 更新 DaemonSet {#updating-a-daemonset}
405405

406406
如果节点的标签被修改,DaemonSet 将立刻向新匹配上的节点添加 Pod,
407407
同时删除不匹配的节点上的 Pod。
@@ -429,7 +429,7 @@ You can [perform a rolling update](/docs/tasks/manage-daemon/update-daemon-set/)
429429

430430
### Init scripts
431431
-->
432-
## DaemonSet 的替代方案 {#alternatives-to-daemon-set}
432+
## DaemonSet 的替代方案 {#alternatives-to-daemonset}
433433

434434
### init 脚本 {#init-scripts}
435435

@@ -479,9 +479,9 @@ in cluster bootstrapping cases. Also, static Pods may be deprecated in the futu
479479
-->
480480
### 静态 Pod {#static-pods}
481481

482-
通过在一个指定的、受 `kubelet` 监视的目录下编写文件来创建 Pod 也是可行的。
482+
通过在一个指定的、受 kubelet 监视的目录下编写文件来创建 Pod 也是可行的。
483483
这类 Pod 被称为[静态 Pod](/zh-cn/docs/tasks/configure-pod-container/static-pod/)。
484-
不像 DaemonSet,静态 Pod 不受 `kubectl` 和其它 Kubernetes API 客户端管理。
484+
不像 DaemonSet,静态 Pod 不受 kubectl 和其它 Kubernetes API 客户端管理。
485485
静态 Pod 不依赖于 API 服务器,这使得它们在启动引导新集群的情况下非常有用。
486486
此外,静态 Pod 在将来可能会被废弃。
487487

@@ -501,7 +501,7 @@ For example, [network plugins](/docs/concepts/extend-kubernetes/compute-storage-
501501
often include a component that runs as a DaemonSet. The DaemonSet component makes sure
502502
that the node where it's running has working cluster networking.
503503
-->
504-
### Deployment
504+
### Deployment {#deployments}
505505

506506
DaemonSet 与 [Deployment](/zh-cn/docs/concepts/workloads/controllers/deployment/) 非常类似,
507507
它们都能创建 Pod,并且 Pod 中的进程都不希望被终止(例如,Web 服务器、存储服务器)。
@@ -511,10 +511,11 @@ DaemonSet 与 [Deployment](/zh-cn/docs/concepts/workloads/controllers/deployment
511511
当需要 Pod 副本总是运行在全部或特定主机上,并且当该 DaemonSet 提供了节点级别的功能(允许其他 Pod 在该特定节点上正确运行)时,
512512
应该使用 DaemonSet。
513513

514-
例如,[网络插件](/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)通常包含一个以 DaemonSet 运行的组件。
515-
这个 DaemonSet 组件确保它所在的节点的集群网络正常工作。
514+
例如,[网络插件](/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)通常包含一个以
515+
DaemonSet 运行的组件。这个 DaemonSet 组件确保它所在的节点的集群网络正常工作。
516516

517517
## {{% heading "whatsnext" %}}
518+
518519
<!--
519520
* Learn about [Pods](/docs/concepts/workloads/pods).
520521
* Learn about [static Pods](#static-pods), which are useful for running Kubernetes
@@ -531,11 +532,12 @@ DaemonSet 与 [Deployment](/zh-cn/docs/concepts/workloads/controllers/deployment
531532
object definition to understand the API for daemon sets.
532533
-->
533534
* 了解 [Pod](/zh-cn/docs/concepts/workloads/pods)。
534-
* 了解[静态 Pod](#static-pods),这对运行 Kubernetes {{< glossary_tooltip text="控制面" term_id="control-plane" >}}组件有帮助。
535+
* 了解[静态 Pod](#static-pods),这对运行 Kubernetes
536+
{{< glossary_tooltip text="控制面" term_id="control-plane" >}}组件有帮助。
535537
* 了解如何使用 DaemonSet
536538
* [对 DaemonSet 执行滚动更新](/zh-cn/docs/tasks/manage-daemon/update-daemon-set/)
537539
* [对 DaemonSet 执行回滚](/zh-cn/docs/tasks/manage-daemon/rollback-daemon-set/)(例如:新的版本没有达到你的预期)
538-
* 理解[Kubernetes 如何将 Pod 分配给节点](/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/)。
540+
* 理解 [Kubernetes 如何将 Pod 分配给节点](/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/)。
539541
* 了解[设备插件](/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/)和
540542
[扩展(Addons)](/zh-cn/docs/concepts/cluster-administration/addons/),它们常以 DaemonSet 运行。
541543
* `DaemonSet` 是 Kubernetes REST API 中的顶级资源。阅读 {{< api-reference page="workload-resources/daemon-set-v1" >}}

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: 对 DaemonSet 执行滚动更新
33
content_type: task
44
weight: 10
55
---
6-
76
<!--
87
reviewers:
98
- janetkuo
@@ -44,7 +43,6 @@ DaemonSet 有两种更新策略:
4443
will be created automatically, in a controlled fashion. At most one pod of
4544
the DaemonSet will be running on each node during the whole update process.
4645
-->
47-
4846
* `OnDelete`:使用 `OnDelete` 更新策略时,在更新 DaemonSet 模板后,只有当你手动删除老的
4947
DaemonSet Pod 之后,新的 DaemonSet Pod **才会**被自动创建。跟 Kubernetes 1.6 以前的版本类似。
5048
* `RollingUpdate`:这是默认的更新策略。使用 `RollingUpdate` 更新策略时,在更新 DaemonSet 模板后,
@@ -125,7 +123,7 @@ kubectl get ds/fluentd-elasticsearch -o go-template='{{.spec.updateStrategy.type
125123
If you haven't created the DaemonSet in the system, check your DaemonSet
126124
manifest with the following command instead:
127125
-->
128-
如果还没在系统中创建 DaemonSet,请使用以下命令检查 DaemonSet 的清单:
126+
如果你还没在系统中创建 DaemonSet,请使用以下命令检查 DaemonSet 的清单:
129127

130128
```shell
131129
kubectl apply -f https://k8s.io/examples/controllers/fluentd-daemonset.yaml --dry-run=client -o go-template='{{.spec.updateStrategy.type}}{{"\n"}}'
@@ -272,12 +270,12 @@ make room for new DaemonSet pods.
272270
-->
273271
一旦找到这些节点,从节点上删除一些非 DaemonSet Pod,为新的 DaemonSet Pod 腾出空间。
274272

273+
{{< note >}}
275274
<!--
276275
This will cause service disruption when deleted pods are not controlled by any controllers or pods are not
277276
replicated. This does not respect [PodDisruptionBudget](/docs/tasks/run-application/configure-pdb/)
278277
either.
279278
-->
280-
{{< note >}}
281279
当所删除的 Pod 不受任何控制器管理,也不是多副本的 Pod 时,上述操作将导致服务中断。
282280
同时,上述操作也不会考虑
283281
[PodDisruptionBudget](/zh-cn/docs/tasks/run-application/configure-pdb/)
@@ -335,4 +333,3 @@ kubectl delete ds fluentd-elasticsearch -n kube-system
335333
-->
336334
* 查看[在 DaemonSet 上执行回滚](/zh-cn/docs/tasks/manage-daemon/rollback-daemon-set/)
337335
* 查看[创建 DaemonSet 以收养现有 DaemonSet Pod](/zh-cn/docs/concepts/workloads/controllers/daemonset/)
338-

content/zh-cn/examples/controllers/daemonset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
effect: NoSchedule
2626
containers:
2727
- name: fluentd-elasticsearch
28-
image: quay.io/fluentd_elasticsearch/fluentd:v2.5.2
28+
image: quay.io/fluentd_elasticsearch/fluentd:v5.0.1
2929
resources:
3030
limits:
3131
memory: 200Mi

content/zh-cn/examples/controllers/fluentd-daemonset-update.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
effect: NoSchedule
3030
containers:
3131
- name: fluentd-elasticsearch
32-
image: quay.io/fluentd_elasticsearch/fluentd:v2.5.2
32+
image: quay.io/fluentd_elasticsearch/fluentd:v5.0.1
3333
resources:
3434
limits:
3535
memory: 200Mi

content/zh-cn/examples/controllers/fluentd-daemonset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
effect: NoSchedule
2626
containers:
2727
- name: fluentd-elasticsearch
28-
image: quay.io/fluentd_elasticsearch/fluentd:v2.5.2
28+
image: quay.io/fluentd_elasticsearch/fluentd:v5.0.1
2929
volumeMounts:
3030
- name: varlog
3131
mountPath: /var/log

0 commit comments

Comments
 (0)