Skip to content

Commit 9e5076b

Browse files
authored
Merge pull request #25880 from yuandongx/patch-12
[zh]Miss url and something is error.
2 parents 0963e4e + d22e255 commit 9e5076b

File tree

1 file changed

+41
-35
lines changed

1 file changed

+41
-35
lines changed

content/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration.md

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,28 @@ The lifecycle of the kubeadm CLI tool is decoupled from the
2525
on each node within the Kubernetes cluster. The kubeadm CLI tool is executed by the user when Kubernetes is
2626
initialized or upgraded, where as the kubelet is always running in the background.
2727
28-
Since the kubelet is a daemon, it needs to be maintained by some kind of a init
28+
Since the kubelet is a daemon, it needs to be maintained by some kind of an init
2929
system or service manager. When the kubelet is installed using DEBs or RPMs,
3030
systemd is configured to manage the kubelet. You can use a different service
3131
manager instead, but you need to configure it manually.
3232
3333
Some kubelet configuration details need to be the same across all kubelets involved in the cluster, while
34-
other configuration aspects need to be set on a per-kubelet basis, to accommodate the different
35-
characteristics of a given machine, such as OS, storage, and networking. You can manage the configuration
36-
of your kubelets manually, but [kubeadm now provides a `KubeletConfiguration` API type for managing your
34+
other configuration aspects need to be set on a per-kubelet basis to accommodate the different
35+
characteristics of a given machine (such as OS, storage, and networking). You can manage the configuration
36+
of your kubelets manually, but kubeadm now provides a `KubeletConfiguration` API type for [managing your
3737
kubelet configurations centrally](#configure-kubelets-using-kubeadm).
3838
-->
3939
kubeadm CLI 工具的生命周期与 [kubelet](/zh/docs/reference/command-line-tools-reference/kubelet)解耦,它是一个守护程序,在 Kubernetes 集群中的每个节点上运行。
4040
当 Kubernetes 初始化或升级时,kubeadm CLI 工具由用户执行,而 kubelet 始终在后台运行。
4141

4242
由于kubelet是守护程序,因此需要通过某种初始化系统或服务管理器进行维护。
4343
当使用 DEB 或 RPM 安装 kubelet 时,配置系统去管理 kubelet。
44-
您可以改用其他服务管理器,但需要手动地配置。
44+
你可以改用其他服务管理器,但需要手动地配置。
4545

46-
集群中涉及的所有 kubelet 的一些配置细节都必须相同,而其他配置方面则需要基于每个 kubelet 进行设置,以适应给定机器的不同特性,例如操作系统、存储和网络。
47-
您可以手动地管理 kubelet 的配置,但是 [kubeadm 现在提供一种 `KubeletConfiguration` API 类型,用于集中管理 kubelet 的配置](#configure-kubelets-using-kubeadm)
46+
集群中涉及的所有 kubelet 的一些配置细节都必须相同,
47+
而其他配置方面则需要基于每个 kubelet 进行设置,以适应给定机器的不同特性(例如操作系统、存储和网络)。
48+
你可以手动地管理 kubelet 的配置,但是 kubeadm 现在提供一种 `KubeletConfiguration` API 类型
49+
用于[集中管理 kubelet 的配置](#configure-kubelets-using-kubeadm)
4850

4951

5052

@@ -91,17 +93,17 @@ clusterDNS:
9193
-->
9294
### 将集群级配置传播到每个 kubelet 中
9395

94-
您可以通过使用 `kubeadm init``kubeadm join` 命令为 kubelet 提供默认值。
96+
你可以通过使用 `kubeadm init``kubeadm join` 命令为 kubelet 提供默认值。
9597
有趣的示例包括使用其他 CRI 运行时或通过服务器设置不同的默认子网。
9698

97-
如果您想使用子网 `10.96.0.0/12` 作为默认的服务,您可以给 kubeadm 传递 `--service-cidr` 参数:
99+
如果你想使用子网 `10.96.0.0/12` 作为默认的服务,你可以给 kubeadm 传递 `--service-cidr` 参数:
98100

99101
```bash
100102
kubeadm init --service-cidr 10.96.0.0/12
101103
```
102104

103105
现在,可以从该子网分配服务的虚拟 IP。
104-
您还需要通过 kubelet 使用 `--cluster-dns` 标志设置 DNS 地址。
106+
你还需要通过 kubelet 使用 `--cluster-dns` 标志设置 DNS 地址。
105107
在集群中的每个管理器和节点上的 kubelet 的设置需要相同。
106108
kubelet 提供了一个版本化的结构化 API 对象,该对象可以配置 kubelet 中的大多数参数,并将此配置推送到集群中正在运行的每个 kubelet 上。
107109
此对象被称为 **kubelet 的配置组件**
@@ -119,7 +121,7 @@ clusterDNS:
119121
<!--
120122
### Providing instance-specific configuration details
121123
122-
Some hosts require specific kubelet configurations, due to differences in hardware, operating system,
124+
Some hosts require specific kubelet configurations due to differences in hardware, operating system,
123125
networking, or other host-specific parameters. The following list provides a few examples.
124126
125127
- The path to the DNS resolution file, as specified by the `--resolv-conf` kubelet
@@ -131,14 +133,14 @@ networking, or other host-specific parameters. The following list provides a few
131133
unless you are using a cloud provider. You can use the `--hostname-override` flag to override the
132134
default behavior if you need to specify a Node name different from the machine's hostname.
133135

134-
- Currently, the kubelet cannot automatically detects the cgroup driver used by the CRI runtime,
136+
- Currently, the kubelet cannot automatically detect the cgroup driver used by the CRI runtime,
135137
but the value of `--cgroup-driver` must match the cgroup driver used by the CRI runtime to ensure
136138
the health of the kubelet.
137139

138140
- Depending on the CRI runtime your cluster uses, you may need to specify different flags to the kubelet.
139141
For instance, when using Docker, you need to specify flags such as `--network-plugin=cni`, but if you
140142
are using an external runtime, you need to specify `--container-runtime=remote` and specify the CRI
141-
endpoint using the `--container-runtime-path-endpoint=<path>`.
143+
endpoint using the `--container-runtime-endpoint=<path>`.
142144

143145
You can specify these flags by configuring an individual kubelet's configuration in your service manager,
144146
such as systemd.
@@ -149,20 +151,20 @@ such as systemd.
149151
以下列表提供了一些示例。
150152

151153
- 由 kubelet 配置标志 `--resolv-confkubelet` 指定的 DNS 解析文件的路径在操作系统之间可能有所不同,
152-
它取决于您是否使用 `systemd-resolved`。
154+
它取决于你是否使用 `systemd-resolved`。
153155
如果此路径错误,则在其 kubelet 配置错误的节点上 DNS 解析也将失败。
154156

155-
- 除非您使用云提供商,否则默认情况下Node API 对象 `.metadata.name` 被设置为计算机的主机名
156-
如果您需要指定一个节点的名称与机器的主机名不同,您可以是使用 `--hostname-override` 标志覆盖默认操作
157+
- 除非你使用云驱动,否则默认情况下 Node API 对象的 `.metadata.name` 会被设置为计算机的主机名
158+
如果你需要指定一个与机器的主机名不同的节点名称,你可以使用 `--hostname-override` 标志覆盖默认值
157159

158160
- 当前,kubelet 无法自动检测 CRI 运行时使用的 cgroup 驱动程序,
159161
但是值 `--cgroup-driver` 必须与 CRI 运行时使用的 cgroup 驱动程序匹配,以确保 kubelet 的健康运行状况。
160162

161-
- 根据您集群使用的 CRI 运行时,您可能需要为 kubelet 指定不同的标志。
162-
例如,当使用 Docker 时,你要需要指定标志如 `--network-plugin=cni`,但是如果您使用的是外部运行时
163-
则需要指定 `--container-runtime=remote` 并使用 `--container-runtime-path-endpoint=<path>` 指定 CRI端点
163+
- 取决于你的集群所使用的 CRI 运行时,你可能需要为 kubelet 指定不同的标志。
164+
例如,当使用 Docker 时,你需要指定如 `--network-plugin=cni` 这类标志;但是如果你使用的是外部运行时
165+
则需要指定 `--container-runtime=remote` 并使用 `--container-runtime-endpoint=<path>` 指定 CRI 端点
164166

165-
您可以在服务管理器(例如系统)中通过对单个的 kubelet 配置来指定这些标志
167+
你可以在服务管理器(例如 systemd)中设定某个 kubelet 的配置来指定这些参数
166168

167169
<!--
168170
## Configure kubelets using kubeadm
@@ -181,7 +183,8 @@ for more information on the individual fields.
181183

182184
如果自定义的 `KubeletConfiguration` API 对象使用像 `kubeadm ... --config some-config-file.yaml` 这样的配置文件进行传递,则可以配置 kubeadm 启动的 kubelet。
183185

184-
通过调用 `kubeadm config print init-defaults --component-configs KubeletConfiguration` 您可以看到此结构中的所有默认值。
186+
通过调用 `kubeadm config print init-defaults --component-configs KubeletConfiguration`,
187+
你可以看到此结构中的所有默认值。
185188

186189
也可以阅读 [kubelet 配置组件的 API 参考](https://godoc.org/k8s.io/kubernetes/pkg/kubelet/apis/config#KubeletConfiguration)来获取有关各个字段的更多信息。
187190

@@ -190,7 +193,7 @@ for more information on the individual fields.
190193

191194
When you call `kubeadm init`, the kubelet configuration is marshalled to disk
192195
at `/var/lib/kubelet/config.yaml`, and also uploaded to a ConfigMap in the cluster. The ConfigMap
193-
is named `kubelet-config-1.X`, where `.X` is the minor version of the Kubernetes version you are
196+
is named `kubelet-config-1.X`, where `X` is the minor version of the Kubernetes version you are
194197
initializing. A kubelet configuration file is also written to `/etc/kubernetes/kubelet.conf` with the
195198
baseline cluster-wide configuration for all kubelets in the cluster. This configuration file
196199
points to the client certificates that allow the kubelet to communicate with the API server. This
@@ -223,7 +226,7 @@ If the reload and restart are successful, the normal `kubeadm init` workflow con
223226

224227
当调用 `kubeadm init` 时,kubelet 配置被编组到磁盘上的 `/var/lib/kubelet/config.yaml` 中,
225228
并且上传到集群中的 ConfigMap。
226-
ConfigMap 名为 `kubelet-config-1.X`,其中 `.X` 是您正在初始化的 kubernetes 版本的次版本。
229+
ConfigMap 名为 `kubelet-config-1.X`,其中 `X` 是你正在初始化的 kubernetes 版本的次版本。
227230
在集群中所有 kubelet 的基准集群范围内配置,将 kubelet 配置文件写入 `/etc/kubernetes/kubelet.conf` 中。
228231
此配置文件指向允许 kubelet 与 API 服务器通信的客户端证书。
229232
这解决了 [将集群级配置传播到每个 kubelet](#propagating-cluster-level-configuration-to-each-kubelet)的需求。
@@ -285,12 +288,12 @@ kubelet 使用这些证书执行 TLS 引导程序并获取唯一的凭据,该
285288
<!--
286289
## The kubelet drop-in file for systemd
287290

288-
kubeadm ships with configuration for how systemd should run the kubelet.
291+
`kubeadm` ships with configuration for how systemd should run the kubelet.
289292
Note that the kubeadm CLI command never touches this drop-in file.
290293

291-
This configuration file installed by the `kubeadm` [DEB](https://github.com/kubernetes/kubernetes/blob/master/build/debs/10-kubeadm.conf) or [RPM package](https://github.com/kubernetes/kubernetes/blob/master/build/rpms/10-kubeadm.conf) is written to
294+
This configuration file installed by the `kubeadm` [DEB](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/deb/kubeadm/10-kubeadm.conf) or [RPM package](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/rpm/kubeadm/10-kubeadm.conf) is written to
292295
`/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` and is used by systemd.
293-
It augments the basic [`kubelet.service` for RPM](https://github.com/kubernetes/kubernetes/blob/master/build/rpms/kubelet.service) (resp. [`kubelet.service` for DEB](https://github.com/kubernetes/kubernetes/blob/master/build/debs/kubelet.service))):
296+
It augments the basic [`kubelet.service` for RPM](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/rpm/kubelet/kubelet.service) or [`kubelet.service` for DEB](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/deb/kubelet/lib/systemd/system/kubelet.service):
294297

295298
```none
296299
[Service]
@@ -321,11 +324,15 @@ This file specifies the default locations for all of the files managed by kubead
321324
-->
322325
## kubelet 的 systemd 文件 {#the-kubelet-drop-in-file-for-systemd}
323326

324-
kubeadm 中附带了有关系统如何运行 kubelet 的 systemd 配置文件。
327+
`kubeadm` 中附带了有关系统如何运行 kubelet 的 systemd 配置文件。
325328
请注意 kubeadm CLI 命令不会修改此文件。
326329

327-
通过 `kubeadm` [DEB](https://github.com/kubernetes/kubernetes/blob/master/build/debs/10-kubeadm.conf) 或者 [RPM 包](https://github.com/kubernetes/kubernetes/blob/master/build/rpms/10-kubeadm.conf) 安装的配置文件已被写入 `/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` 并由系统使用。
328-
它加强了基础设施 [`kubelet.service` for RPM](https://github.com/kubernetes/kubernetes/blob/master/build/rpms/kubelet.service) (resp. [`kubelet.service` for DEB](https://github.com/kubernetes/kubernetes/blob/master/build/debs/kubelet.service))):
330+
通过 `kubeadm` [DEB](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/deb/kubeadm/10-kubeadm.conf)
331+
或者 [RPM 包](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/rpm/kubeadm/10-kubeadm.conf)
332+
安装的配置文件被写入 `/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` 并由系统使用。
333+
它对原来的 [RPM 版本 `kubelet.service`](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/rpm/kubelet/kubelet.service)
334+
或者 [DEB 版本 `kubelet.service`](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/deb/kubelet/lib/systemd/system/kubelet.service)
335+
作了增强:
329336

330337
```none
331338
[Service]
@@ -361,10 +368,9 @@ The DEB and RPM packages shipped with the Kubernetes releases are:
361368
| Package name | Description |
362369
|--------------|-------------|
363370
| `kubeadm` | Installs the `/usr/bin/kubeadm` CLI tool and the [kubelet drop-in file](#the-kubelet-drop-in-file-for-systemd) for the kubelet. |
364-
| `kubelet` | Installs the `/usr/bin/kubelet` binary. |
371+
| `kubelet` | Installs the kubelet binary in `/usr/bin` and CNI binaries in `/opt/cni/bin`. |
365372
| `kubectl` | Installs the `/usr/bin/kubectl` binary. |
366-
| `kubernetes-cni` | Installs the official CNI binaries into the `/opt/cni/bin` directory. |
367-
| `cri-tools` | Installs the `/usr/bin/crictl` binary from the [cri-tools git repository](https://github.com/kubernetes-incubator/cri-tools). |
373+
| `cri-tools` | Installs the `/usr/bin/crictl` binary from the [cri-tools git repository](https://github.com/kubernetes-sigs/cri-tools). |
368374
-->
369375
## Kubernetes 二进制文件和软件包内容
370376

@@ -373,8 +379,8 @@ Kubernetes 版本对应的 DEB 和 RPM 软件包是:
373379
| Package name | Description |
374380
|--------------|-------------|
375381
| `kubeadm` | 给 kubelet 安装 `/usr/bin/kubeadm` CLI 工具和 [kubelet 的 systemd 文件](#the-kubelet-drop-in-file-for-systemd)。 |
376-
| `kubelet` | 安装 `/usr/bin/kubelet` 二进制文件和 `/opt/cni/bin` CNI 二进制文件。 |
377-
| `kubectl` | 安装 `/usr/bin/kubectl` 二进制文件。 |
378-
| `cri-tools` | 从 [cri-tools git 仓库](https://github.com/kubernetes-incubator/cri-tools)中安装 `/usr/bin/crictl` 二进制文件。 |
382+
| `kubelet` | 安装 kublet 可执行文件到 `/usr/bin` 路径,安装 CNI 可执行文件到 `/opt/cni/bin` 路径。 |
383+
| `kubectl` | 安装 `/usr/bin/kubectl` 可执行文件。 |
384+
| `cri-tools` | 从 [cri-tools git 仓库](https://github.com/kubernetes-sigs/cri-tools)中安装 `/usr/bin/crictl` 可执行文件。 |
379385

380386

0 commit comments

Comments
 (0)