@@ -9,7 +9,6 @@ content_type: concept
9
9
weight : 40
10
10
hide_summary : true # 在章节索引中单独列出
11
11
---
12
-
13
12
<!--
14
13
reviewers:
15
14
- enisoc
@@ -68,16 +67,16 @@ different flags and/or different memory and cpu requests for different hardware
68
67
69
68
### Create a DaemonSet
70
69
-->
71
- ## 编写 DaemonSet Spec {#writing-a-daemon-set -spec}
70
+ ## 编写 DaemonSet 规约 {#writing-a-daemonset -spec}
72
71
73
- ### 创建 DaemonSet {#create-a-daemon-set }
72
+ ### 创建 DaemonSet {#create-a-daemonset }
74
73
75
74
<!--
76
75
You can describe a DaemonSet in a YAML file. For example, the `daemonset.yaml` file below
77
76
describes a DaemonSet that runs the fluentd-elasticsearch Docker image:
78
77
-->
79
78
你可以在 YAML 文件中描述 DaemonSet。
80
- 例如,下面的 daemonset.yaml 文件描述了一个运行 fluentd-elasticsearch Docker 镜像的 DaemonSet:
79
+ 例如,下面的 ` daemonset.yaml ` 文件描述了一个运行 fluentd-elasticsearch Docker 镜像的 DaemonSet:
81
80
82
81
{{% code_sample file="controllers/daemonset.yaml" %}}
83
82
@@ -86,7 +85,7 @@ Create a DaemonSet based on the YAML file:
86
85
-->
87
86
基于 YAML 文件创建 DaemonSet:
88
87
89
- ```
88
+ ``` shell
90
89
kubectl apply -f https://k8s.io/examples/controllers/daemonset.yaml
91
90
```
92
91
@@ -114,7 +113,8 @@ section.
114
113
DaemonSet 对象的名称必须是一个合法的
115
114
[ DNS 子域名] ( /zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names ) 。
116
115
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 ) 。
118
118
119
119
<!--
120
120
### Pod Template
@@ -137,7 +137,7 @@ A Pod Template in a DaemonSet must have a [`RestartPolicy`](/docs/concepts/workl
137
137
138
138
` .spec.template ` 是一个 [ Pod 模板] ( /zh-cn/docs/concepts/workloads/pods/#pod-templates ) 。
139
139
除了它是嵌套的,因而不具有 ` apiVersion ` 或 ` kind ` 字段之外,它与
140
- {{< glossary_tooltip text="Pod" term_id="pod" >}} 具有相同的 schema 。
140
+ {{< glossary_tooltip text="Pod" term_id="pod" >}} 具有相同的模式 。
141
141
142
142
除了 Pod 必需字段外,在 DaemonSet 中的 Pod 模板必须指定合理的标签(查看 [ Pod 选择算符] ( #pod-selector ) )。
143
143
@@ -179,7 +179,7 @@ The `.spec.selector` is an object consisting of two fields:
179
179
-->
180
180
* ` matchLabels ` - 与 [ ReplicationController] ( /zh-cn/docs/concepts/workloads/controllers/replicationcontroller/ )
181
181
的 ` .spec.selector ` 的作用相同。
182
- * ` matchExpressions ` - 允许构建更加复杂的选择器 ,可以通过指定 key、value
182
+ * ` matchExpressions ` - 允许构建更加复杂的选择算符 ,可以通过指定 key、value
183
183
列表以及将 key 和 value 列表关联起来的 Operator。
184
184
185
185
<!--
@@ -215,7 +215,7 @@ If you do not specify either, then the DaemonSet controller will create Pods on
215
215
<!--
216
216
## How Daemon Pods are scheduled
217
217
-->
218
- ## Daemon Pods 是如何被调度的 {#how-daemon-pods-are-scheduled}
218
+ ## Daemon Pod 是如何被调度的 {#how-daemon-pods-are-scheduled}
219
219
220
220
<!--
221
221
A DaemonSet can be used to ensure that all eligible nodes run a copy of a Pod.
@@ -299,7 +299,7 @@ nodeAffinity:
299
299
The DaemonSet controller automatically adds a set of {{< glossary_tooltip
300
300
text="tolerations" term_id="toleration" >}} to DaemonSet Pods:
301
301
-->
302
- ### 污点和容忍度 {#taint -and-toleration }
302
+ ### 污点和容忍度 {#taints -and-tolerations }
303
303
304
304
DaemonSet 控制器会自动将一组容忍度添加到 DaemonSet Pod:
305
305
@@ -401,7 +401,7 @@ You can modify the Pods that a DaemonSet creates. However, Pods do not allow al
401
401
fields to be updated. Also, the DaemonSet controller will use the original template the next
402
402
time a node (even with the same name) is created.
403
403
-->
404
- # # 更新 DaemonSet {#updating-a-daemon-set }
404
+ # # 更新 DaemonSet {#updating-a-daemonset }
405
405
406
406
如果节点的标签被修改,DaemonSet 将立刻向新匹配上的节点添加 Pod,
407
407
同时删除不匹配的节点上的 Pod。
@@ -429,7 +429,7 @@ You can [perform a rolling update](/docs/tasks/manage-daemon/update-daemon-set/)
429
429
430
430
# ## Init scripts
431
431
-->
432
- # # DaemonSet 的替代方案 {#alternatives-to-daemon-set }
432
+ # # DaemonSet 的替代方案 {#alternatives-to-daemonset }
433
433
434
434
# ## init 脚本 {#init-scripts}
435
435
@@ -479,9 +479,9 @@ in cluster bootstrapping cases. Also, static Pods may be deprecated in the futu
479
479
-->
480
480
# ## 静态 Pod {#static-pods}
481
481
482
- 通过在一个指定的、受 ` kubelet` 监视的目录下编写文件来创建 Pod 也是可行的。
482
+ 通过在一个指定的、受 kubelet 监视的目录下编写文件来创建 Pod 也是可行的。
483
483
这类 Pod 被称为[静态 Pod](/zh-cn/docs/tasks/configure-pod-container/static-pod/)。
484
- 不像 DaemonSet,静态 Pod 不受 ` kubectl` 和其它 Kubernetes API 客户端管理。
484
+ 不像 DaemonSet,静态 Pod 不受 kubectl 和其它 Kubernetes API 客户端管理。
485
485
静态 Pod 不依赖于 API 服务器,这使得它们在启动引导新集群的情况下非常有用。
486
486
此外,静态 Pod 在将来可能会被废弃。
487
487
@@ -501,7 +501,7 @@ For example, [network plugins](/docs/concepts/extend-kubernetes/compute-storage-
501
501
often include a component that runs as a DaemonSet. The DaemonSet component makes sure
502
502
that the node where it's running has working cluster networking.
503
503
-->
504
- # ## Deployment
504
+ # ## Deployment {#deployments}
505
505
506
506
DaemonSet 与 [Deployment](/zh-cn/docs/concepts/workloads/controllers/deployment/) 非常类似,
507
507
它们都能创建 Pod,并且 Pod 中的进程都不希望被终止(例如,Web 服务器、存储服务器)。
@@ -511,10 +511,11 @@ DaemonSet 与 [Deployment](/zh-cn/docs/concepts/workloads/controllers/deployment
511
511
当需要 Pod 副本总是运行在全部或特定主机上,并且当该 DaemonSet 提供了节点级别的功能(允许其他 Pod 在该特定节点上正确运行)时,
512
512
应该使用 DaemonSet。
513
513
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 组件确保它所在的节点的集群网络正常工作。
516
516
517
517
# # {{% heading "whatsnext" %}}
518
+
518
519
<!--
519
520
* Learn about [Pods](/docs/concepts/workloads/pods).
520
521
* 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
531
532
object definition to understand the API for daemon sets.
532
533
-->
533
534
* 了解 [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" >}}组件有帮助。
535
537
* 了解如何使用 DaemonSet
536
538
* [对 DaemonSet 执行滚动更新](/zh-cn/docs/tasks/manage-daemon/update-daemon-set/)
537
539
* [对 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/)。
539
541
* 了解[设备插件](/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/)和
540
542
[扩展(Addons)](/zh-cn/docs/concepts/cluster-administration/addons/),它们常以 DaemonSet 运行。
541
543
* `DaemonSet` 是 Kubernetes REST API 中的顶级资源。阅读 {{< api-reference page="workload-resources/daemon-set-v1" >}}
0 commit comments