Skip to content

Commit 0f9e81b

Browse files
authored
Merge pull request #43485 from my-git9/install-kubeadm
[zh-cn] sync kubeadm/install-kubeadm.md kubelet-integration.md write-new-topic.md
2 parents 84bed71 + de272f1 commit 0f9e81b

File tree

3 files changed

+75
-34
lines changed

3 files changed

+75
-34
lines changed

content/zh-cn/docs/contribute/style/write-new-topic.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ that you write. The docs site provides templates or
5959
new content pages. To create a new type of page, run `hugo new` with the path to the file
6060
you want to create. For example:
6161
-->
62-
### 创建一个新页面{#creating-a-new-page}
62+
### 创建一个新页面 {#creating-a-new-page}
6363

6464
为每个新页面选择其[内容类型](/zh-cn/docs/contribute/style/page-content-types/)
6565
文档站提供了模板或 [Hugo Archetypes](https://gohugo.io/content-management/archetypes/) 来创建新的内容页面。
@@ -225,13 +225,13 @@ reusable, and you want the reader to try it out themselves.
225225
<!--
226226
When adding a new standalone sample file, such as a YAML file, place the code in
227227
one of the `<LANG>/examples/` subdirectories where `<LANG>` is the language for
228-
the topic. In your topic file, use the `codenew` shortcode:
228+
the topic. In your topic file, use the `code_sample` shortcode:
229229
-->
230230
添加新的独立示例文件(如 YAML 文件)时,将代码放在 `<LANG>/examples/` 的某个子目录中,
231-
其中 `<LANG>` 是该主题的语言。在主题文件中使用 `codenew` 短代码:
231+
其中 `<LANG>` 是该主题的语言。在主题文件中使用 `code_sample` 短代码:
232232

233233
```none
234-
{{%/* codenew file="<RELPATH>/my-example-yaml>" */%}}
234+
{{%/* code_sample file="<RELPATH>/my-example-yaml>" */%}}
235235
```
236236

237237
<!--
@@ -245,7 +245,7 @@ file located at `/content/en/examples/pods/storage/gce-volume.yaml`.
245245
文件。
246246

247247
```none
248-
{{%/* codenew file="pods/storage/gce-volume.yaml" */%}}
248+
{{%/* code_sample file="pods/storage/gce-volume.yaml" */%}}
249249
```
250250

251251
<!--
@@ -268,13 +268,13 @@ In your topic, show this command:
268268
kubectl create -f https://k8s.io/examples/pods/storage/gce-volume.yaml
269269
```
270270

271+
{{< note >}}
271272
<!--
272273
When adding new YAML files to the `<LANG>/examples` directory, make
273274
sure the file is also included into the `<LANG>/examples_test.go` file. The
274275
Travis CI for the Website automatically runs this test case when PRs are
275276
submitted to ensure all examples pass the tests.
276277
-->
277-
{{< note >}}
278278
将新的 YAML 文件添加到 `<LANG>/examples` 目录时,请确保该文件也在
279279
`<LANG>/examples_test.go` 文件中被引用。
280280
当提交拉取请求时,网站的 Travis CI 会自动运行此测试用例,以确保所有示例都通过测试。
@@ -284,8 +284,8 @@ submitted to ensure all examples pass the tests.
284284
For an example of a topic that uses this technique, see
285285
[Running a Single-Instance Stateful Application](/docs/tasks/run-application/run-single-instance-stateful-application/).
286286
-->
287-
有关使用此技术的主题的示例,请参见
288-
[运行单实例有状态的应用](/zh-cn/docs/tasks/run-application/run-single-instance-stateful-application/)
287+
有关使用此技术的主题的示例,
288+
请参见[运行单实例有状态的应用](/zh-cn/docs/tasks/run-application/run-single-instance-stateful-application/)
289289

290290
<!--
291291
## Adding images to a topic
@@ -302,6 +302,5 @@ Put image files in the `/images` directory. The preferred image format is SVG.
302302
* Learn about [using page content types](/docs/contribute/style/page-content-types/).
303303
* Learn about [creating a pull request](/docs/contribute/new-content/open-a-pr/).
304304
-->
305-
* 了解[使用页面内容类型](/zh-cn/docs/contribute/style/page-content-types/).
306-
* 了解[创建 PR](/zh-cn/docs/contribute/new-content/open-a-pr/).
307-
305+
* 了解[使用页面内容类型](/zh-cn/docs/contribute/style/page-content-types/)
306+
* 了解[创建 PR](/zh-cn/docs/contribute/new-content/open-a-pr/)

content/zh-cn/docs/setup/production-environment/tools/kubeadm/install-kubeadm.md

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ see the [Creating a cluster with kubeadm](/docs/setup/production-environment/too
3030
有关在执行此安装过程后如何使用 kubeadm 创建集群的信息,
3131
请参见[使用 kubeadm 创建集群](/zh-cn/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/)
3232

33+
<!--
34+
This installation guide is for Kubernetes {{< skew currentVersion >}}. If you want to use a different
35+
Kubernetes version, please refer to the following pages instead:
36+
-->
37+
本安装指南适用于 Kubernetes {{< skew currentVersion >}}。
38+
如果你想使用不同版本的 Kubernetes,请参阅以下页面:
39+
40+
<!--
41+
- [Installing kubeadm for Kubernetes {{< skew currentVersionAddMinor -1 "." >}}](https://v{{< skew currentVersionAddMinor -1 "-" >}}.docs.kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)
42+
- [Installing kubeadm for Kubernetes {{< skew currentVersionAddMinor -2 "." >}}](https://v{{< skew currentVersionAddMinor -2 "-" >}}.docs.kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)
43+
- [Installing kubeadm for Kubernetes {{< skew currentVersionAddMinor -3 "." >}}](https://v{{< skew currentVersionAddMinor -3 "-" >}}.docs.kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)
44+
- [Installing kubeadm for Kubernetes {{< skew currentVersionAddMinor -4 "." >}}](https://v{{< skew currentVersionAddMinor -4 "-" >}}.docs.kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)
45+
-->
46+
- [为 Kubernetes {{< skew currentVersionAddMinor -1 "." >}} 安装 kubeadm](https://v{{< skew currentVersionAddMinor -1 "-" >}}.docs.kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)
47+
- [为 Kubernetes {{< skew currentVersionAddMinor -2 "." >}} 安装 kubeadm](https://v{{< skew currentVersionAddMinor -2 "-" >}}.docs.kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)
48+
- [为 Kubernetes {{< skew currentVersionAddMinor -3 "." >}} 安装 kubeadm](https://v{{< skew currentVersionAddMinor -3 "-" >}}.docs.kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)
49+
- [为 Kubernetes {{< skew currentVersionAddMinor -4 "." >}} 安装 kubeadm](https://v{{< skew currentVersionAddMinor -4 "-" >}}.docs.kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)
50+
3351
## {{% heading "prerequisites" %}}
3452

3553
<!--
@@ -305,6 +323,18 @@ Kubernetes 从 2023 年 8 月开始使用托管在 `pkgs.k8s.io`
305323
更多细节参阅[弃用和冻结公告](/zh-cn/blog/2023/08/31/legacy-package-repository-deprecation/)
306324
{{< /note >}}
307325

326+
{{< note >}}
327+
<!--
328+
There's a dedicated package repository for each Kubernetes minor version. If you want to install
329+
a minor version other than {{< skew currentVersion >}}, please see the installation guide for
330+
your desired minor version. The official Kubernetes package repositories provide downloads for
331+
Kubernetes versions starting with v1.24.0.
332+
-->
333+
每个 Kubernetes 小版本都有一个专用的软件包仓库。
334+
如果你想安装 {{< skew currentVersion >}} 以外的次要版本,请参阅所需次要版本的安装指南。
335+
官方 Kubernetes 软件包仓库提供 Kubernetes v1.24.0 及更高版本软件包的下载。
336+
{{< /note >}}
337+
308338
{{< tabs name="k8s_install" >}}
309339
{{% tab name="基于 Debian 的发行版" %}}
310340

@@ -335,9 +365,16 @@ These instructions are for Kubernetes {{< skew currentVersion >}}.
335365
```
336366

337367
<!--
338-
3. Add the Kubernetes `apt` repository:
368+
3. Add the appropriate Kubernetes `apt` repository. Please note that this repository have packages
369+
only for Kubernetes {{< skew currentVersion >}}; for other Kubernetes minor versions, you need to
370+
change the Kubernetes minor version in the URL to match your desired minor version
371+
(you should also check that you are reading the documentation for the version of Kubernetes
372+
that you plan to install).
339373
-->
340-
3. 添加 Kubernetes `apt` 仓库:
374+
3. 添加 Kubernetes `apt` 仓库。
375+
请注意,此仓库仅包含适用于 Kubernetes {{< skew currentVersion >}} 的软件包;
376+
对于其他 Kubernetes 次要版本,则需要更改 URL 中的 Kubernetes 次要版本以匹配你所需的次要版本
377+
(你还应该检查正在阅读的安装文档是否为你计划安装的 Kubernetes 版本的文档)。
341378

342379
```shell
343380
# 此操作会覆盖 /etc/apt/sources.list.d/kubernetes.list 中现存的所有配置。
@@ -379,7 +416,7 @@ you can create it by running `sudo mkdir -m 755 /etc/apt/keyrings`
379416
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
380417
```
381418
-->
382-
1. 将 SELinux 设置为 `permissive` 模式:
419+
1. 将 SELinux 设置为 `permissive` 模式
383420

384421
以下指令适用于 Kubernetes {{< skew currentVersion >}}。
385422

@@ -408,11 +445,19 @@ you can create it by running `sudo mkdir -m 755 /etc/apt/keyrings`
408445
2. Add the Kubernetes `yum` repository. The `exclude` parameter in the
409446
repository definition ensures that the packages related to Kubernetes are
410447
not upgraded upon running `yum update` as there's a special procedure that
411-
must be followed for upgrading Kubernetes.
448+
must be followed for upgrading Kubernetes. Please note that this repository
449+
have packages only for Kubernetes {{< skew currentVersion >}}; for other
450+
Kubernetes minor versions, you need to change the Kubernetes minor version
451+
in the URL to match your desired minor version (you should also check that
452+
you are reading the documentation for the version of Kubernetes that you
453+
plan to install).
412454
-->
413455
2. 添加 Kubernetes 的 `yum` 仓库。在仓库定义中的 `exclude` 参数确保了与
414456
Kubernetes 相关的软件包在运行 `yum update` 时不会升级,因为升级
415-
Kubernetes 需要遵循特定的过程。
457+
Kubernetes 需要遵循特定的过程。请注意,此仓库仅包含适用于
458+
Kubernetes {{< skew currentVersion >}} 的软件包;
459+
对于其他 Kubernetes 次要版本,则需要更改 URL 中的 Kubernetes 次要版本以匹配你所需的次要版本
460+
(你还应该检查正在阅读的安装文档是否为你计划安装的 Kubernetes 版本的文档)。
416461

417462
```shell
418463
# 此操作会覆盖 /etc/yum.repos.d/kubernetes.repo 中现存的所有配置
@@ -494,10 +539,10 @@ cd $DOWNLOAD_DIR
494539
sudo curl -L --remote-name-all https://dl.k8s.io/release/${RELEASE}/bin/linux/${ARCH}/{kubeadm,kubelet}
495540
sudo chmod +x {kubeadm,kubelet}
496541
497-
RELEASE_VERSION="v0.15.1"
498-
curl -sSL "https://raw.githubusercontent.com/kubernetes/release/${RELEASE_VERSION}/cmd/kubepkg/templates/latest/deb/kubelet/lib/systemd/system/kubelet.service" | sed "s:/usr/bin:${DOWNLOAD_DIR}:g" | sudo tee /etc/systemd/system/kubelet.service
542+
RELEASE_VERSION="v0.16.2"
543+
curl -sSL "https://raw.githubusercontent.com/kubernetes/release/${RELEASE_VERSION}/cmd/krel/templates/latest/kubelet/kubelet.service" | sed "s:/usr/bin:${DOWNLOAD_DIR}:g" | sudo tee /etc/systemd/system/kubelet.service
499544
sudo mkdir -p /etc/systemd/system/kubelet.service.d
500-
curl -sSL "https://raw.githubusercontent.com/kubernetes/release/${RELEASE_VERSION}/cmd/kubepkg/templates/latest/deb/kubeadm/10-kubeadm.conf" | sed "s:/usr/bin:${DOWNLOAD_DIR}:g" | sudo tee /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
545+
curl -sSL "https://raw.githubusercontent.com/kubernetes/release/${RELEASE_VERSION}/cmd/krel/templates/latest/kubeadm/10-kubeadm.conf" | sed "s:/usr/bin:${DOWNLOAD_DIR}:g" | sudo tee /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
501546
```
502547
503548
{{< note >}}
@@ -574,8 +619,8 @@ If you are running into difficulties with kubeadm, please consult our
574619
-->
575620
## 故障排查 {#troubleshooting}
576621
577-
如果你在使用 kubeadm 时遇到困难,请参阅我们的
578-
[故障排查文档](/zh-cn/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/)。
622+
如果你在使用 kubeadm 时遇到困难,
623+
请参阅我们的[故障排查文档](/zh-cn/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/)。
579624
580625
## {{% heading "whatsnext" %}}
581626

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

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ In addition to the flags used when starting the kubelet, the file also contains
222222
parameters such as the cgroup driver and whether to use a different container runtime socket
223223
(`--cri-socket`).
224224
-->
225-
除了启动 kubelet 时所使用的标志外,该文件还包含动态参数,例如 cgroup 驱动程序以及是否使用其他容器运行时套接字(`--cri-socket`)。
225+
除了启动 kubelet 时所使用的标志外,该文件还包含动态参数,例如 cgroup
226+
驱动程序以及是否使用其他容器运行时套接字(`--cri-socket`)。
226227

227228
<!--
228229
After marshalling these two files to disk, kubeadm attempts to run the following two
@@ -277,7 +278,7 @@ When the `/etc/kubernetes/kubelet.conf` file is written, the kubelet has finishe
277278
Kubeadm deletes the `/etc/kubernetes/bootstrap-kubelet.conf` file after completing the TLS Bootstrap.
278279
-->
279280
当 `/etc/kubernetes/kubelet.conf` 文件被写入后,kubelet 就完成了 TLS 引导过程。
280-
Kubeadm 在完成 TLS 引导过程后将删除 `/etc/kubernetes/bootstrap-kubelet.conf` 文件。
281+
kubeadm 在完成 TLS 引导过程后将删除 `/etc/kubernetes/bootstrap-kubelet.conf` 文件。
281282

282283
<!--
283284
## The kubelet drop-in file for systemd
@@ -293,19 +294,15 @@ Note that the kubeadm CLI command never touches this drop-in file.
293294

294295
<!--
295296
This configuration file installed by the `kubeadm`
296-
[DEB](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/deb/kubeadm/10-kubeadm.conf) or
297-
[RPM package](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/rpm/kubeadm/10-kubeadm.conf) is written to
297+
[package](https://github.com/kubernetes/release/blob/cd53840/cmd/krel/templates/latest/kubeadm/10-kubeadm.conf) is written to
298298
`/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` and is used by systemd.
299299
It augments the basic
300-
[`kubelet.service` for RPM](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/rpm/kubelet/kubelet.service) or
301-
[`kubelet.service` for DEB](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/deb/kubelet/lib/systemd/system/kubelet.service):
300+
[`kubelet.service`](https://github.com/kubernetes/release/blob/cd53840/cmd/krel/templates/latest/kubelet/kubelet.service):
302301
-->
303-
通过 `kubeadm` [DEB 包](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/deb/kubeadm/10-kubeadm.conf)
304-
或者 [RPM 包](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/rpm/kubeadm/10-kubeadm.conf)
305-
安装的配置文件被写入 `/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` 并由 systemd 使用。
306-
它对原来的 [RPM 版本 `kubelet.service`](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/rpm/kubelet/kubelet.service)
307-
或者 [DEB 版本 `kubelet.service`](https://github.com/kubernetes/release/blob/master/cmd/kubepkg/templates/latest/deb/kubelet/lib/systemd/system/kubelet.service)
308-
作了增强:
302+
通过 `kubeadm` [包](https://github.com/kubernetes/release/blob/cd53840/cmd/krel/templates/latest/kubeadm/10-kubeadm.conf)
303+
安装的配置文件被写入 `/etc/systemd/system/kubelet.service.d/10-kubeadm.conf`
304+
并由 systemd 使用。它对原来的
305+
[`kubelet.service`](https://github.com/kubernetes/release/blob/cd53840/cmd/krel/templates/latest/kubelet/kubelet.service) 作了增强:
309306

310307
{{< note >}}
311308
<!--
@@ -314,7 +311,7 @@ follow the guide outlined in the ([Without a package manager](/docs/setup/produc
314311
section.
315312
-->
316313
下面的内容只是一个例子。如果你不想使用包管理器,
317-
请遵循([没有包管理器](/zh-cn/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#k8s-install-2))
314+
请遵循[没有包管理器](/zh-cn/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#k8s-install-2)
318315
章节的指南。
319316
{{< /note >}}
320317

0 commit comments

Comments
 (0)