@@ -21,7 +21,7 @@ You need to install a
21
21
{{< glossary_tooltip text="container runtime" term_id="container-runtime" >}}
22
22
into each node in the cluster so that Pods can run there. This page outlines
23
23
what is involved and describes related tasks for setting up nodes.
24
- -->
24
+ -->
25
25
你需要在集群内每个节点上安装一个
26
26
{{< glossary_tooltip text="容器运行时" term_id="container-runtime" >}}
27
27
以使 Pod 可以运行在上面。本文概述了所涉及的内容并描述了与节点设置相关的任务。
@@ -145,7 +145,7 @@ sysctl net.bridge.bridge-nf-call-iptables net.bridge.bridge-nf-call-ip6tables ne
145
145
```
146
146
147
147
<!--
148
- ## Cgroup drivers
148
+ ## cgroup drivers
149
149
150
150
On Linux, {{< glossary_tooltip text="control groups" term_id="cgroup" >}}
151
151
are used to constrain resources that are allocated to processes.
@@ -155,12 +155,12 @@ are used to constrain resources that are allocated to processes.
155
155
在 Linux 上,{{<glossary_tooltip text="控制组(CGroup)" term_id="cgroup" >}}用于限制分配给进程的资源。
156
156
157
157
<!--
158
- Both {{< glossary_tooltip text="kubelet" term_id="kubelet" >}} and the
158
+ Both the {{< glossary_tooltip text="kubelet" term_id="kubelet" >}} and the
159
159
underlying container runtime need to interface with control groups to enforce
160
- [resource management for pods and containers](/docs/concepts/configuration/manage-resources-containers/) and set
161
- resources such as cpu/memory requests and limits. To interface with control
160
+ [resource management for pods and containers](/docs/concepts/configuration/manage-resources-containers/)
161
+ and set resources such as cpu/memory requests and limits. To interface with control
162
162
groups, the kubelet and the container runtime need to use a *cgroup driver*.
163
- It's critical that the kubelet and the container runtime uses the same cgroup
163
+ It's critical that the kubelet and the container runtime use the same cgroup
164
164
driver and are configured the same.
165
165
-->
166
166
{{< glossary_tooltip text="kubelet" term_id="kubelet" >}} 和底层容器运行时都需要对接控制组来强制执行
@@ -182,16 +182,15 @@ There are two cgroup drivers available:
182
182
<!--
183
183
### cgroupfs driver {#cgroupfs-cgroup-driver}
184
184
185
- The `cgroupfs` driver is the default cgroup driver in the kubelet. When the `cgroupfs`
186
- driver is used, the kubelet and the container runtime directly interface with
185
+ The `cgroupfs` driver is the [ default cgroup driver in the kubelet](docs/reference/config-api/kubelet-config.v1beta1).
186
+ When the `cgroupfs` driver is used, the kubelet and the container runtime directly interface with
187
187
the cgroup filesystem to configure cgroups.
188
188
189
189
The `cgroupfs` driver is **not** recommended when
190
190
[systemd](https://www.freedesktop.org/wiki/Software/systemd/) is the
191
191
init system because systemd expects a single cgroup manager on
192
- the system. Additionally, if you use [cgroup v2](/docs/concepts/architecture/cgroups)
193
- , use the `systemd` cgroup driver instead of
194
- `cgroupfs`.
192
+ the system. Additionally, if you use [cgroup v2](/docs/concepts/architecture/cgroups), use the `systemd`
193
+ cgroup driver instead of `cgroupfs`.
195
194
-->
196
195
### cgroupfs 驱动 {#cgroupfs-cgroup-driver}
197
196
@@ -237,6 +236,7 @@ the kubelet and the container runtime when systemd is the selected init system.
237
236
238
237
当 systemd 是选定的初始化系统时,缓解这个不稳定问题的方法是针对 kubelet 和容器运行时将
239
238
` systemd ` 用作 cgroup 驱动。
239
+
240
240
<!--
241
241
To set `systemd` as the cgroup driver, edit the
242
242
[`KubeletConfiguration`](/docs/tasks/administer-cluster/kubelet-config-file/)
@@ -252,13 +252,22 @@ kind: KubeletConfiguration
252
252
cgroupDriver : systemd
253
253
` ` `
254
254
255
+ {{< note >}}
256
+ <!--
257
+ Starting with v1.22 and later, when creating a cluster with kubeadm, if the user does not set
258
+ the ` cgroupDriver` field under `KubeletConfiguration`, kubeadm defaults it to `systemd`.
259
+ -->
260
+ 从 v1.22 开始,在使用 kubeadm 创建集群时,如果用户没有在
261
+ ` KubeletConfiguration` 下设置 `cgroupDriver` 字段,kubeadm 默认使用 `systemd`。
262
+ {{< /note >}}
263
+
255
264
<!--
256
265
If you configure `systemd` as the cgroup driver for the kubelet, you must also
257
266
configure `systemd` as the cgroup driver for the container runtime. Refer to
258
267
the documentation for your container runtime for instructions. For example :
259
268
-->
260
- 如果你将 `systemd` 配置为 kubelet 的 cgroup 驱动,你也必须将 `systemd` 配置为容器运行时的 cgroup 驱动。
261
- 参阅容器运行时文档,了解指示说明。例如:
269
+ 如果你将 `systemd` 配置为 kubelet 的 cgroup 驱动,你也必须将 `systemd`
270
+ 配置为容器运行时的 cgroup 驱动。 参阅容器运行时文档,了解指示说明。例如:
262
271
263
272
* [containerd](#containerd-systemd)
264
273
* [CRI-O](#cri-o)
@@ -311,14 +320,14 @@ using the (deprecated) v1alpha2 API instead.
311
320
312
321
你的容器运行时必须至少支持 v1alpha2 版本的容器运行时接口。
313
322
314
- Kubernetes [从 1.26 版本开始](/blog/2022/11/18/upcoming-changes-in-kubernetes-1-26/#cri-api-removal)**仅适用于**
323
+ Kubernetes [从 1.26 版本开始](/blog/2022/11/18/upcoming-changes-in-kubernetes-1-26/#cri-api-removal)**仅适用于**
315
324
v1 版本的容器运行时(CRI)API。早期版本默认为 v1 版本,
316
325
但是如果容器运行时不支持 v1 版本的 API,
317
326
则 kubelet 会回退到使用(已弃用的)v1alpha2 版本的 API。
318
327
319
328
<!--
320
329
# # Container runtimes
321
- -->
330
+ -->
322
331
# # 容器运行时
323
332
324
333
{{% thirdparty-content %}}
@@ -331,9 +340,9 @@ This section outlines the necessary steps to use containerd as CRI runtime.
331
340
本节概述了使用 containerd 作为 CRI 运行时的必要步骤。
332
341
333
342
<!--
334
- Follow the instructions for [getting started with containerd](https://github.com/containerd/containerd/blob/main/docs/getting-started.md). Return to this step once you've created a valid configuration file, `config.toml`.
335
-
336
- To install containerd on your system, follow the instructions on [getting started with containerd](https://github.com/containerd/containerd/blob/main/docs/getting-started.md). Return to this step once you've created a valid `config.toml` configuration file.
343
+ To install containerd on your system, follow the instructions on
344
+ [getting started with containerd](https://github.com/containerd/containerd/blob/main/docs/getting-started.md).
345
+ Return to this step once you've created a valid `config.toml` configuration file.
337
346
-->
338
347
要在系统上安装 containerd,请按照[开始使用 containerd](https://github.com/containerd/containerd/blob/main/docs/getting-started.md)
339
348
的说明进行操作。创建有效的 `config.toml` 配置文件后返回此步骤。
@@ -606,4 +615,3 @@ As well as a container runtime, your cluster will need a working
606
615
[network plugin](/docs/concepts/cluster-administration/networking/#how-to-implement-the-kubernetes-networking-model).
607
616
-->
608
617
除了容器运行时,你的集群还需要有效的[ 网络插件] ( /zh-cn/docs/concepts/cluster-administration/networking/#how-to-implement-the-kubernetes-networking-model ) 。
609
-
0 commit comments